import { Row, TouchableHighlight } from 'components/layout'; import { Text } from 'components/text'; import { Visible } from 'components/visible'; import { FC, useCallback } from 'react'; import { Switch as LocalSwitch, SwitchProps as LocalSwitchProps } from 'react-native-switch'; import { COLOR_VALUES } from 'theme/color'; export const Switch: FC = ({ titlePosition, title, onValueChange, value, ...props }) => { const isLeft = titlePosition === 'left' && !!title; const handleChange = useCallback(() => { if (onValueChange) { onValueChange(!value); } }, [onValueChange, value]); return ( {title} {title} ); }; type SwitchType = LocalSwitchProps & SwitchProps; export interface SwitchProps { title?: string; titlePosition?: 'left' | 'right'; }