feat(frontend): 4-zone shell + F1 loop end-to-end (MSW)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { useState } from "react";
|
||||
import { createSession } from "../api/sessions";
|
||||
import { useSessionStream } from "../stream/useSessionStream";
|
||||
import { WidgetHost } from "./WidgetHost";
|
||||
|
||||
export function AppShell() {
|
||||
const [activeSessionId, setActiveSessionId] = useState<string | null>(null);
|
||||
|
||||
useSessionStream(activeSessionId);
|
||||
|
||||
async function handleNuovaDomanda() {
|
||||
const { id } = await createSession({ workspace: "default", question: "" });
|
||||
setActiveSessionId(id);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-screen">
|
||||
{/* Left nav / session list */}
|
||||
<aside className="w-48 border-r p-2 flex flex-col gap-2">
|
||||
<button
|
||||
className="border rounded px-2 py-1 text-sm hover:bg-accent"
|
||||
onClick={handleNuovaDomanda}
|
||||
>
|
||||
Nuova domanda
|
||||
</button>
|
||||
</aside>
|
||||
|
||||
<div className="flex flex-col flex-1">
|
||||
{/* Top workflow bar */}
|
||||
<header className="border-b px-4 py-2 text-sm text-muted-foreground">
|
||||
Workflow
|
||||
</header>
|
||||
|
||||
{/* Center: chat + input */}
|
||||
<main className="flex-1 overflow-auto p-4">
|
||||
<WidgetHost sessionId={activeSessionId} />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{/* Right artifact sidebar */}
|
||||
<aside className="w-64 border-l p-2">
|
||||
<p className="text-xs text-muted-foreground">Artefatti</p>
|
||||
</aside>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user