Spaces:
Sleeping
Sleeping
| import React, { useState } from 'react'; | |
| import ProfilingScreen from './screens/ProfileScreen/ProfilingScreen'; | |
| import ChatInterfaceScreen from './screens/ChatInterfaceScreen/ChatInterfaceScreen'; | |
| import { UserProfile } from './interface'; | |
| const App: React.FC = () => { | |
| const [phase, setPhase] = useState<'profiling' | 'chat'>('profiling'); | |
| const [userProfile, setUserProfile] = useState<UserProfile>({}); | |
| // Handler to move from profiling to chat, passing userProfile if needed | |
| const handleStartChat = (profile: UserProfile) => { | |
| console.log('Starting chat with profile:', profile); | |
| setUserProfile(profile); | |
| setPhase('chat'); | |
| }; | |
| return phase === 'profiling' ? ( | |
| <ProfilingScreen onComplete={handleStartChat} /> | |
| ) : ( | |
| <ChatInterfaceScreen userProfile={userProfile} /> | |
| ); | |
| }; | |
| export default App; |