import { LinearGradient } from 'expo-linear-gradient'; import { useRouter } from 'expo-router'; import { Building2, ChevronRight, ShieldCheck, User } from 'lucide-react-native'; import React from 'react'; import { Animated, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { PersonType, useRegister } from './lib/useRegisterStore'; const PERSON_TYPES: { key: PersonType; label: string; description: string; icon: React.ReactNode; gradient: [string, string]; }[] = [ { key: 'yatt', label: 'YATT', description: "Yakka tartibdagi tadbirkor", icon: , gradient: ['#10b981', '#059669'], }, { key: 'band', label: "O'zini o'zi band qilgan", description: "O'z faoliyatini mustaqil yurituvchi", icon: , gradient: ['#3b82f6', '#2563eb'], }, { key: 'legal_entity', label: 'Yuridik shaxs', description: "Tashkilot yoki korxona", icon: , gradient: ['#f59e0b', '#d97706'], }, ]; function TypeCard({ item, index, onPress, }: { item: (typeof PERSON_TYPES)[number]; index: number; onPress: () => void; }) { const scale = React.useRef(new Animated.Value(1)).current; const handlePressIn = () => { Animated.spring(scale, { toValue: 0.96, useNativeDriver: true, }).start(); }; const handlePressOut = () => { Animated.spring(scale, { toValue: 1, friction: 4, useNativeDriver: true, }).start(); }; return ( {item.icon} {item.label} {item.description} ); } export default function PersonTypeScreen() { const router = useRouter(); const { setPersonType } = useRegister(); const handleSelect = (type: PersonType) => { setPersonType(type); router.push('/(auth)/register-form'); }; return ( Ro'yxatdan o'tish Faoliyat turingizni tanlang {PERSON_TYPES.map((item, index) => ( handleSelect(item.key)} /> ))} router.back()} testID="go-to-login"> Hisobingiz bormi? Kirish ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#0f172a', }, safeArea: { flex: 1, paddingHorizontal: 24, }, header: { alignItems: 'center', marginTop: 40, marginBottom: 36, }, title: { fontSize: 28, fontWeight: '800' as const, color: '#ffffff', marginBottom: 10, letterSpacing: 0.5, }, subtitle: { fontSize: 15, color: '#94a3b8', textAlign: 'center', lineHeight: 22, }, cardList: { gap: 14, }, card: { flexDirection: 'row', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.06)', borderRadius: 20, padding: 18, borderWidth: 1, borderColor: 'rgba(255, 255, 255, 0.1)', gap: 16, }, cardIcon: { width: 56, height: 56, borderRadius: 16, alignItems: 'center', justifyContent: 'center', }, cardContent: { flex: 1, }, cardTitle: { fontSize: 17, fontWeight: '700' as const, color: '#ffffff', marginBottom: 4, }, cardDescription: { fontSize: 13, color: '#94a3b8', lineHeight: 18, }, footer: { marginTop: 'auto' as const, paddingBottom: 20, alignItems: 'center', }, footerText: { color: '#94a3b8', fontSize: 14, }, footerLink: { color: '#3b82f6', fontWeight: '700' as const, }, decorCircle1: { position: 'absolute', top: -150, right: -100, width: 400, height: 400, borderRadius: 200, backgroundColor: 'rgba(59, 130, 246, 0.1)', }, decorCircle2: { position: 'absolute', bottom: -100, left: -150, width: 350, height: 350, borderRadius: 175, backgroundColor: 'rgba(16, 185, 129, 0.08)', }, });