import './switch.css' ; import React , { Component } from 'react' ; type Props = { on : boolean ; onClick : ( event : React . MouseEvent < HTMLButtonElement > ) => void ; className ? : string ; } ; class Switch extends Component < Props > { render ( ) { const { on , className = '' , ... props } = this . props ; const btnClassName = [ className , 'toggle-btn' , on ? 'toggle-btn-on' : 'toggle-btn-off' ] . filter ( Boolean ) . join ( ' ' ) ; return ( < div > < input className = "toggle-input" type = "checkbox" checked = { on } onChange = { ( ) => { } } /> < button className = { btnClassName } aria - label = "Toggle" { ... props } /> < /div>); } } export { Switch } ;