({children, description, errorMessage, ...props}: SwitchProps)
| 16 | } |
| 17 | |
| 18 | export function Switch({children, description, errorMessage, ...props}: SwitchProps) { |
| 19 | return ( |
| 20 | <SwitchField {...props}> |
| 21 | <SwitchButton> |
| 22 | {({isSelected, isDisabled}) => ( |
| 23 | <> |
| 24 | <div className="track indicator"> |
| 25 | <div |
| 26 | data-disabled={isDisabled || undefined} |
| 27 | className={isSelected ? 'handle' : 'handle indicator'} |
| 28 | /> |
| 29 | </div> |
| 30 | {children} |
| 31 | </> |
| 32 | )} |
| 33 | </SwitchButton> |
| 34 | {description && <Description>{description}</Description>} |
| 35 | <FieldError>{errorMessage}</FieldError> |
| 36 | </SwitchField> |
| 37 | ); |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected