Merge pull request 'Link component fully covered' (#28) from feature/link-component into develop

Reviewed-on: http://85.143.176.51:3000/free-land/front-end/pulls/28
This commit is contained in:
Denis Gorbunov 2022-07-27 15:47:36 +00:00
commit 39a7f64252

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>
);
}