import clsx from 'clsx'; import React, { useRef } from 'react'; interface IToggle extends Pick, 'id' | 'checked' | 'onChange' | 'required'> { } /** A glorified checkbox. Wrapper around react-toggle. */ const Toggle: React.FC = ({ id, checked, onChange, required }) => { const input = useRef(null); const handleClick: React.MouseEventHandler = (e) => { e.preventDefault(); input.current?.focus(); input.current?.click(); }; return ( ); }; export default Toggle;