This repository has been archived on 2024-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
icynet-admin/components/common/Button/Button.tsx

24 lines
523 B
TypeScript
Raw Permalink Normal View History

2022-09-01 14:23:11 +00:00
import { MouseEventHandler } from 'react';
import styles from './Button.module.scss';
export const Button = ({
variant = 'default',
onClick,
children,
...props
}: {
2022-09-09 14:37:42 +00:00
variant?: 'default' | 'primary' | 'secondary' | 'link';
2022-09-01 14:23:11 +00:00
onClick: MouseEventHandler<HTMLButtonElement>;
children?: React.ReactNode;
2022-09-01 18:11:36 +00:00
} & JSX.IntrinsicElements['button']) => {
2022-09-01 14:23:11 +00:00
return (
<button
{...props}
className={[styles.button, styles[variant]].join(' ')}
onClick={onClick}
>
{children}
</button>
);
};