pages/Chat¶
Remarks¶
The main chat UI for AILA. Provides:
Conversation list (create, select, inline rename)
Streaming chat with backend (
/request
endpoint)Persistence via AuthContextType
Per‑message feedback (👍/👎)
Responsive sidebar (mobile overlay)
Data Flow
On mount → fetch user’s conversations.
Auto‑select first conversation & fetch messages.
Local
messages
mirror contextuserMessages
for real‑time patching.On submit:
Append user + placeholder assistant messages.
Stream tokens and patch assistant message.
Persist messages and refresh conversation.
Accessibility¶
Uses semantic buttons & aria-friendly state updates.
Styling¶
TailwindCSS for layout & theming.
lucide-react icons (User, Bot, Menu, X).
Framer Motion for subtle entrance animation on greeting.
Example¶
import Chat from './pages/Chat';
<Route path="/chat" element={<Chat />} />
Functions¶
References¶
default¶
Renames and re-exports Chat