import * as React from 'react'; import { Icon } from '../Icon'; import { cx } from '../../utils/cx'; export interface CheckBoxProps { onClick: VoidFunction; checked: boolean; className?: string; disabled?: boolean; } export const CheckBox = ({ onClick, checked, className = '', children, disabled, }: React.PropsWithChildren): JSX.Element => { const handleClick = () => { if (disabled) { return; } onClick(); }; return (
{checked && ( )} {children}
); };