import { SetStateAction, VFC } from 'react'; export type CheckboxProps = { /** * One or more ids that refers to the checkbox name. */ 'aria-labelledby'?: string; /** * Add classnames to the checkbox. */ className?: string; /** * Checkbox id attribute. */ id: string; /** * Checkbox name attribute. */ name: string; /** * Callback function to set checkbox value. */ setValue: (value: SetStateAction) => void; /** * Checkbox value. */ value: boolean; }; /** * Checkbox component * * Render a checkbox type input. */ const Checkbox: VFC = ({ value, setValue, ...props }) => { return ( setValue(!value)} {...props} /> ); }; export default Checkbox;