2022-01-31 12:16:30 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
|
2022-01-29 16:52:47 +00:00
|
|
|
type ButtonProps = {
|
|
|
|
className?: string;
|
2022-01-31 12:16:30 +00:00
|
|
|
href?: string;
|
2022-01-29 16:52:47 +00:00
|
|
|
children: React.ReactChild | React.ReactChild[];
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function Button(props: ButtonProps): JSX.Element {
|
2022-01-31 12:16:30 +00:00
|
|
|
const button = (
|
2022-01-29 16:52:47 +00:00
|
|
|
<div
|
2022-02-18 18:29:25 +00:00
|
|
|
className={`grid place-content-center place-items-center border-[1px] border-dark text-dark rounded-full cursor-pointer px-4 pt-[0.4rem] pb-[0.5rem] transition-all hover:text-light hover:bg-dark hover:drop-shadow-dark-lg active:bg-black active:drop-shadow-black-lg active:border-black ${props.className}`}
|
2022-01-29 16:52:47 +00:00
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
|
|
|
);
|
2022-01-31 12:16:30 +00:00
|
|
|
|
|
|
|
const result = props.href ? (
|
|
|
|
<Link href={props.href} passHref>
|
|
|
|
{button}
|
|
|
|
</Link>
|
|
|
|
) : (
|
|
|
|
button
|
|
|
|
);
|
|
|
|
return result;
|
2022-01-29 16:52:47 +00:00
|
|
|
}
|