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
514 B
TypeScript
Raw 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
}: {
variant?: 'default' | 'primary' | 'secondary';
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>
);
};