import _ from "lodash"; import { isUndefined } from "lodash"; interface CheckboxSliderProps extends React.InputHTMLAttributes { checked?: boolean; disabled?: boolean; noFocusBorder?: boolean; testClassId?: string; } /** Just classes up a checkbox to look like a slider. Deviates from onChange etc for * compatibility with `InputHTMLAttributes`, to expose eg. id to use with htmlFor. */ export const CheckboxSlider = (props: CheckboxSliderProps) => { let styles = {}; const noFocus = isUndefined(props.noFocusBorder) ? true : props.noFocusBorder; if (noFocus) styles = {boxShadow: "none", borderColor: "inherit"}; return ( ) }