import React from 'react'; import { Switch, Text, TextStyle, View, ViewStyle } from 'react-native'; import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; import styles from './styles'; interface ISwitchContainer { value: boolean; disabled?: boolean; leftLabelPrimary: string; leftLabelSecondary: string; rightLabelPrimary?: string; rightLabelSecondary?: string; onValueChange: (value: any) => void; theme: string; testID: string; labelContainerStyle?: ViewStyle; leftLabelStyle?: TextStyle; } const SwitchContainer: React.FC = React.memo( ({ children, value, disabled, onValueChange, leftLabelPrimary, leftLabelSecondary, rightLabelPrimary, rightLabelSecondary, theme, testID, labelContainerStyle, leftLabelStyle }) => ( <> {leftLabelPrimary && ( {leftLabelPrimary} {leftLabelSecondary} )} {rightLabelPrimary && ( {rightLabelPrimary} {rightLabelSecondary} )} {children} ) ); export default SwitchContainer;