import React, { useState } from 'react'; import { View, Text, ScrollView, TouchableOpacity, Alert } from 'react-native'; import { useAppTheme } from '@theme'; import { CustomInput, PrimaryButton, ChipSelector } from '@components'; import { PersonIcon } from '@icons'; import { useNavigation } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { OnBoardingParamList } from '@navigation/navigationTypes'; import { RouteNames } from '@utils/constants'; import { Gender, VehicleType } from '@interfaces'; import { getStyles } from './completeProfileScreen.styles'; import { useAppDispatch, useAppSelector } from '@store'; import { completeOnboard } from './thunk'; export const CompleteProfileScreen: React.FC = () => { const { colors } = useAppTheme(); const styles = getStyles(colors); const navigation = useNavigation>(); const [fullName, setFullName] = useState(''); const [email, setEmail] = useState(''); const [vehicleNo, setVehicleNo] = useState(''); const [gender, setGender] = useState(''); const [vehicleType, setVehicleType] = useState(''); // const [isLoading, setIsLoading] = useState(false); const dispatch = useAppDispatch(); const { isLoading } = useAppSelector(state => state.onboard); const genderOptions = Object.values(Gender).map(v => ({ label: v, value: v, })); const vehicleTypeOptions = Object.values(VehicleType || '').map(v => ({ label: v, value: v, })); // const documents = [ // { id: 'dl', title: 'Driving License', sub: 'Verified', status: 'verified' }, // { // id: 'aadhaar', // title: 'Aadhaar Card', // sub: 'Verified', // status: 'verified', // }, // { id: 'rc', title: 'Vehicle RC', sub: 'Verified', status: 'verified' }, // { // id: 'insurance', // title: 'Insurance Policy', // sub: 'Expires on 12 May 2026', // status: 'expiring', // }, // ]; // const handleDocumentPress = (docTitle: string) => { // Alert.alert('Document Details', `Viewing or uploading ${docTitle}...`); // }; const handleSubmit = () => { if (!fullName || !email || !vehicleNo || !gender || !vehicleType) { Alert.alert( 'Required Fields', 'Please fill out all profile information including gender and vehicle type.', ); return; } dispatch( completeOnboard({ name: fullName, email: email, vehicleNumber: vehicleNo, gender: gender, vehicleType: vehicleType, }), ) .unwrap() .then(() => { navigation.navigate(RouteNames.Kyc); }) .catch(error => { Alert.alert('Error', error.message); }); }; return ( Complete Profile Enter details & upload documents to get verified {/* Profile Avatar Upload Mock */} Add Photo + {/* Personal Details */} Personal Details {/* Gender Selection */} Gender setGender(val)} /> {/* Vehicle Type Selection */} Vehicle Type setVehicleType(val)} /> {/* Required Documents Checklist */} {/* Required Documents {documents.map((doc) => ( handleDocumentPress(doc.title)} > {doc.title} {doc.sub} {doc.status === 'verified' ? 'VERIFIED' : 'ACTIVE'} ))} */} ); }; export default CompleteProfileScreen;