website/components/Button.tsx
TheClashFruit 6fdc97b98b
All checks were successful
Deploy Website / build (push) Successful in 1m28s
feat: navbar, homepage header
2024-04-21 16:48:51 +02:00

28 lines
801 B
TypeScript

import styles from '@/styles/Button.module.scss';
import Link from 'next/link';
type Props = {
href?: string;
children: React.ReactNode;
className?: string;
disabled?: boolean;
type: 'primary' | 'outlined';
[key: string]: any;
};
export default function Button({ href, children, className, disabled, type, ...props }: Props) {
return (
<>
{href ? (
<Link href={href} className={className ? `${className} ${styles.button}` : styles.button} data-type={type} data-disabled={disabled} {...props}>
{children}
</Link>
) : (
<button className={className ? `${className} ${styles.button}` : styles.button} disabled={disabled} data-type={type} data-disabled={disabled} {...props}>
{children}
</button>
)}
</>
);
}