import { Checkbox, FormControlLabel } from "@material-ui/core"; import React from "react"; export interface ControlledCheckboxProps { className?: string; name: string; label?: React.ReactNode; checked: boolean; indeterminate?: boolean; disabled?: boolean; checkedIcon?: React.ReactNode; testId?: string; onChange(event: any); } export const ControlledCheckbox: React.FC = ({ checked, disabled, name, label, onChange, checkedIcon, indeterminate, testId, ...props }) => ( onChange({ target: { name, value: !checked } })} /> } label={label} {...props} /> ); ControlledCheckbox.displayName = "ControlledCheckbox"; export default ControlledCheckbox;