import * as React from "react"; const cssStyle = require("./Switch.scss"); export interface SwitchProperties { value?: boolean; initialState?: boolean; className?: string; label?: string | React.ReactElement; labelSide?: "right" | "left"; disabled?: boolean; onChange?: (value: boolean) => void; onBlur?: () => void; } export interface SwitchState { checked: boolean; disabled?: boolean; } export class Switch extends React.Component { private readonly ref = React.createRef(); constructor(props) { super(props); this.state = { checked: this.props.initialState, } } render() { const disabled = typeof this.state.disabled === "boolean" ? this.state.disabled : !!this.props.disabled; return ( ) } focus() { this.ref.current?.focus(); } }