import { useMemo, useState } from "react"; import { Outlet } from "react-router-dom"; import { Header } from "@/client/components/header"; import { Footer } from "@/client/components/footer"; import { ToastContainer } from "@/client/components/toast"; import { loadInboxSessions, storeInboxSession, type InboxSession, type InboxSessionSummary } from "@/client/lib/api"; export interface AppShellContext { sessions: InboxSessionSummary[]; onCreated: (session: InboxSession) => void; onDeleted: (address: string) => void; } export function AppShell() { const [sessions, setSessions] = useState(() => loadInboxSessions()); const sessionCount = useMemo(() => sessions.length, [sessions]); const handleCreated = (session: InboxSession) => { setSessions(storeInboxSession(session)); }; const handleDeleted = (_address: string) => { setSessions(loadInboxSessions()); }; const context: AppShellContext = { sessions, onCreated: handleCreated, onDeleted: handleDeleted, }; return (
Skip to content
); }