({ value, onValueChange, color }: SwitchProps)
| 7 | } |
| 8 | |
| 9 | const Switch = ({ value, onValueChange, color }: SwitchProps) => { |
| 10 | const background = value ? color : 'none'; |
| 11 | return ( |
| 12 | <> |
| 13 | <input |
| 14 | checked={value} |
| 15 | onChange={onValueChange} |
| 16 | className="react-switch-checkbox" |
| 17 | id={`react-switch-new`} |
| 18 | type="checkbox" |
| 19 | /> |
| 20 | <label |
| 21 | style={{ background }} |
| 22 | className="react-switch-label" |
| 23 | htmlFor={`react-switch-new`} |
| 24 | > |
| 25 | <span className={`react-switch-button`} /> |
| 26 | </label> |
| 27 | </> |
| 28 | ); |
| 29 | }; |
| 30 | |
| 31 | export default Switch; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…