import './index.css' import { memo, forwardRef } from 'react' import { useId } from '@react-aria/utils' import SwitchInput, { type SwitchInputProps } from './SwitchInput' import { SwitchWithLabel } from './SwitchWithLabel' export type SwitchProps = SwitchInputProps const Switch = forwardRef(function Switch( { children, onChange, disabled, className, id, ...props }, ref, ) { const htmlId = useId(id) const noChildren = children === undefined const input = ( ) if (noChildren) { return input } return ( {children} ) }) export default memo(Switch)