22 lines
476 B
TypeScript
22 lines
476 B
TypeScript
import React from "react";
|
|
|
|
type Props = {
|
|
href?: string;
|
|
children: React.ReactNode;
|
|
disabled?: boolean;
|
|
className?: string;
|
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "">;
|
|
|
|
export default function Link({ href, children, disabled, ...props }: Props) {
|
|
return (
|
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
<a
|
|
href={disabled ? undefined : href}
|
|
aria-disabled={disabled}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</a>
|
|
);
|
|
}
|