import React, { useState } from "react"; import { View, Alert, ScrollView } from "react-native"; import { useRouter } from "expo-router"; import { MyText, tw, MyTouchableOpacity } from "common-ui"; import { useAuth } from "@/src/contexts/AuthContext"; import RegistrationForm from "@/components/registration-form"; function Register() { const router = useRouter(); const { register } = useAuth(); const [isLoading, setIsLoading] = useState(false); const handleRegister = async (data: { name: string; email: string; mobile: string; password: string; imageKey?: string; }) => { setIsLoading(true); try { await register(data); // Auth context will handle navigation on successful registration } catch (error: any) { Alert.alert( 'Registration Failed', error.message || 'Failed to create account. Please try again.' ); } finally { setIsLoading(false); } }; return ( Create Account Join us to start your journey Already have an account? router.push('/(auth)/login')}> Sign in ); } export default Register;