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