import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import AppText from 'components/AppText';
import NavbarBack from 'components/NavbarBack';
import { ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import ArrowRightUnderline from 'svg/ArrowRightUnderline';

const SettingsLock = () => {
  const navigation = useNavigation<NativeStackNavigationProp<any>>();
  return (
    <SafeAreaView style={{ flex: 1 }}>
      <View style={styles.container}>
        <NavbarBack title="Parol o'rnatish" />
        <ScrollView>
          <View style={{ width: '95%', margin: 'auto', marginTop: 20 }}>
            <AppText style={styles.title}>Parol turini tanlang</AppText>
            <TouchableOpacity
              style={[styles.card]}
              onPress={() =>
                navigation.navigate('AddLock', { lockType: 'pin' })
              }
            >
              <AppText style={styles.label}>Pin-kod</AppText>
              <ArrowRightUnderline color="#383838" />
            </TouchableOpacity>

            <TouchableOpacity
              style={[styles.card]}
              onPress={() =>
                navigation.navigate('AddLock', { lockType: 'password' })
              }
            >
              <AppText style={styles.label}>Parol</AppText>
              <ArrowRightUnderline color="#383838" />
            </TouchableOpacity>

            <TouchableOpacity
              style={[styles.card]}
              onPress={() =>
                navigation.navigate('AddLock', { lockType: 'pattern' })
              }
            >
              <AppText style={styles.label}>Chizma</AppText>
              <ArrowRightUnderline color="#383838" />
            </TouchableOpacity>
          </View>
        </ScrollView>
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  title: {
    fontSize: 16,
    fontWeight: '500',
  },
  label: {
    fontWeight: '400',
    fontSize: 16,
  },
  card: {
    backgroundColor: '#FFFFFF',
    shadowColor: '#F3FAFF',
    shadowOffset: { width: 0, height: 2 },
    shadowOpacity: 0.3,
    shadowRadius: 4,
    flexDirection: 'row',
    justifyContent: 'space-between',
    padding: 15,
    marginTop: 10,
    borderRadius: 10,
    alignItems: 'center',
  },
});

export default SettingsLock;
