Link component fully covered

This commit is contained in:
decamel 2022-07-27 18:46:14 +03:00
parent 8f9a1035e1
commit a4606eb9f3

View File

@ -0,0 +1,21 @@
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>
);
}