import { Switch, Text, View } from 'react-native';

export const SwitchRow = ({
  label,
  description,
  value,
  onValueChange,
}: {
  label: string;
  description?: string;
  value: boolean;
  onValueChange: (value: boolean) => void;
}) => (
  <View className='border-border flex-row items-center justify-between gap-4 border-b py-3'>
    <View className='min-w-0 flex-1'>
      <Text className='text-foreground font-medium'>{label}</Text>
      {description ? (
        <Text className='text-muted-foreground mt-1 text-xs'>
          {description}
        </Text>
      ) : null}
    </View>
    <Switch value={value} onValueChange={onValueChange} />
  </View>
);
