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

import { styles } from './styles';
import { Colors } from 'src/theme';

import { Header, PageWrapper } from 'src/components';

const SystemNotificationsScreen = () => {
  const [isSubscribed, setIsSubscribed] = useState(false);

  const toggleSwitch = () => setIsSubscribed((prevState) => !prevState);

  return (
    <PageWrapper>
      <Header label="System" />
      <TouchableOpacity
        style={[styles.alignStyle, styles.buttonWrapper, { justifyContent: 'space-between' }]}
        onPress={() => {}}
      >
        <View style={styles.alignStyle}>
          <Text style={[styles.buttonLabel, !isSubscribed ? { color: Colors.LIGHT_GRAY } : {}]}>
            System notifications
          </Text>
        </View>
        <View>
          <Switch
            trackColor={{ false: Colors.LIGHT_GRAY, true: Colors.DARK_BLUE }}
            thumbColor={Colors.WHITE}
            onValueChange={toggleSwitch}
            value={isSubscribed}
            style={{ transform: 'scale(0.8)' }}
          />
        </View>
      </TouchableOpacity>
    </PageWrapper>
  );
};

export default SystemNotificationsScreen;
