Link component fully covered
This commit is contained in:
parent
8f9a1035e1
commit
a4606eb9f3
21
src/components/typography/Link.tsx
Normal file
21
src/components/typography/Link.tsx
Normal 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>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user