import type { SwitchProps } from 'react-native' import { Switch as RNSwitch } from 'react-native' import type { ComponentState } from '../../core/types' import { copyComponentProperties } from '../utils' import { useAccentColor } from './useAccentColor' import { useStyle } from './useStyle' export const Switch = copyComponentProperties(RNSwitch, (props: SwitchProps) => { const state = { isDisabled: Boolean(props.disabled), } satisfies ComponentState const style = useStyle(props.className, props, state) const trackColorOn = useAccentColor(props.trackColorOnClassName, props, state) const trackColorOff = useAccentColor(props.trackColorOffClassName, props, state) const thumbColor = useAccentColor(props.thumbColorClassName, props, state) const ios_backgroundColor = useAccentColor(props.ios_backgroundColorClassName, props, state) return ( ) }) export default Switch