Keep the composer stable during interruptible session changes. Move active and blocked goals into the header with localized gallery previews, and preserve focus when overlays close. Include the reviewed navigation, layout and accessibility fixes.
24 lines
1.1 KiB
TypeScript
24 lines
1.1 KiB
TypeScript
import { useState } from "react";
|
|
import { ThreadComposer } from "@/components/thread/ThreadComposer";
|
|
|
|
export function ComposerActionFixture({ parameters }: { parameters: URLSearchParams }) {
|
|
const [running, setRunning] = useState(false);
|
|
const [stopRequested, setStopRequested] = useState(false);
|
|
return <main className="mx-auto w-full max-w-5xl px-4 pt-24">
|
|
<ThreadComposer
|
|
variant={parameters.get("composerVariant") === "thread" ? "thread" : "hero"}
|
|
placeholder={parameters.has("opening") ? "Opening a new topic…" : undefined}
|
|
modelLabel="Preview"
|
|
isStreaming={running}
|
|
onTranscribeAudio={async () => "Voice draft"}
|
|
onSend={() => { setStopRequested(false); setRunning(true); }}
|
|
onStop={() => setStopRequested(true)}
|
|
/>
|
|
<div className="mt-6 flex gap-4 text-sm">
|
|
<output aria-label="Execution status">{stopRequested ? "Stop requested" : running ? "Working" : "Idle"}</output>
|
|
<button onClick={() => { setRunning(false); setStopRequested(false); }}>Finish response</button>
|
|
<button onClick={() => document.documentElement.classList.toggle("dark")}>Toggle theme</button>
|
|
</div>
|
|
</main>;
|
|
}
|