()
| 10 | import { AnnouncerProvider } from "@/components/a11y/Announcer"; |
| 11 | |
| 12 | export function ChatLayout() { |
| 13 | const { conversations, createConversation, activeConversationId } = useChatStore(); |
| 14 | |
| 15 | useEffect(() => { |
| 16 | if (conversations.length === 0) { |
| 17 | createConversation(); |
| 18 | } |
| 19 | }, []); |
| 20 | |
| 21 | return ( |
| 22 | <AnnouncerProvider> |
| 23 | <SkipToContent /> |
| 24 | <div className="flex h-screen bg-surface-950 text-surface-100"> |
| 25 | <Sidebar /> |
| 26 | <div className="flex flex-col flex-1 min-w-0"> |
| 27 | <Header /> |
| 28 | <main |
| 29 | id="main-content" |
| 30 | aria-label="Chat" |
| 31 | className="flex flex-col flex-1 min-h-0" |
| 32 | > |
| 33 | {activeConversationId ? ( |
| 34 | <> |
| 35 | <ChatWindow conversationId={activeConversationId} /> |
| 36 | <ChatInput conversationId={activeConversationId} /> |
| 37 | </> |
| 38 | ) : ( |
| 39 | <div className="flex-1 flex items-center justify-center text-surface-500"> |
| 40 | Select or create a conversation |
| 41 | </div> |
| 42 | )} |
| 43 | </main> |
| 44 | </div> |
| 45 | </div> |
| 46 | </AnnouncerProvider> |
| 47 | ); |
| 48 | } |
nothing calls this directly
no outgoing calls
no test coverage detected