import { Switch as ChakraSwitch } from "@chakra-ui/react" import * as React from "react" export interface SwitchProps extends ChakraSwitch.RootProps { inputProps?: React.InputHTMLAttributes rootRef?: React.RefObject trackLabel?: { on: React.ReactNode; off: React.ReactNode } thumbLabel?: { on: React.ReactNode; off: React.ReactNode } } export const Switch = React.forwardRef( function Switch(props, ref) { const { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } = props return ( {thumbLabel && ( {thumbLabel?.on} )} {trackLabel && ( {trackLabel.on} )} {children != null && ( {children} )} ) }, )