"use client"; import { useState } from 'react'; interface NameInputScreenProps { onNameSubmit: (name: string) => void; } export default function NameInputScreen({ onNameSubmit }: NameInputScreenProps) { const [fullName, setFullName] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!fullName.trim()) { setError('Please enter your full name'); return; } if (fullName.trim().split(' ').length < 2) { setError('Please enter your first and last name'); return; } setIsLoading(true); setError(''); // Small delay to show loading state setTimeout(() => { onNameSubmit(fullName.trim()); }, 500); }; return (
Please provide your full name to continue