index.tsx 414 B

12345678910111213141516171819
  1. import cn from 'classnames'
  2. import s from './index.module.css'
  3. type CheckboxProps = {
  4. checked?: boolean
  5. onCheck?: () => void
  6. className?: string
  7. }
  8. const Checkbox = ({ checked, onCheck, className }: CheckboxProps) => {
  9. return (
  10. <div
  11. className={cn(s.wrapper, checked && s.checked, 'w-4 h-4 border rounded border-gray-300', className)}
  12. onClick={onCheck}
  13. />
  14. )
  15. }
  16. export default Checkbox