feat: add end session button to chat header

This commit is contained in:
Nathan Flurry 2026-01-27 21:03:33 -08:00
parent 53a06becb1
commit 962512a0db
3 changed files with 29 additions and 1 deletions

View file

@ -548,6 +548,16 @@ export default function App() {
}
};
const endSession = async () => {
if (!sessionId) return;
try {
await getClient().terminateSession(sessionId);
await fetchSessions();
} catch (error) {
setSessionError(getErrorMessage(error, "Unable to end session"));
}
};
const questionRequests = useMemo(() => {
const latestById = new Map<string, QuestionEventData>();
for (const event of events) {
@ -859,6 +869,7 @@ export default function App() {
onVariantChange={setVariant}
onStreamModeChange={setStreamMode}
onToggleStream={toggleStream}
onEndSession={endSession}
hasSession={Boolean(sessionId)}
eventError={eventError}
questionRequests={questionRequests}