mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 20:01:27 +00:00
feat: add end session button to chat header
This commit is contained in:
parent
53a06becb1
commit
962512a0db
3 changed files with 29 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { MessageSquare, PauseCircle, PlayCircle, Plus, Terminal } from "lucide-react";
|
||||
import { MessageSquare, PauseCircle, PlayCircle, Plus, Square, Terminal } from "lucide-react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import type { AgentInfo, AgentModeInfo, PermissionEventData, QuestionEventData } from "sandbox-agent";
|
||||
import ApprovalsTab from "../debug/ApprovalsTab";
|
||||
|
|
@ -39,6 +39,7 @@ const ChatPanel = ({
|
|||
onVariantChange,
|
||||
onStreamModeChange,
|
||||
onToggleStream,
|
||||
onEndSession,
|
||||
eventError,
|
||||
questionRequests,
|
||||
permissionRequests,
|
||||
|
|
@ -79,6 +80,7 @@ const ChatPanel = ({
|
|||
onVariantChange: (value: string) => void;
|
||||
onStreamModeChange: (value: "poll" | "sse" | "turn") => void;
|
||||
onToggleStream: () => void;
|
||||
onEndSession: () => void;
|
||||
eventError: string | null;
|
||||
questionRequests: QuestionEventData[];
|
||||
permissionRequests: PermissionEventData[];
|
||||
|
|
@ -131,6 +133,17 @@ const ChatPanel = ({
|
|||
)}
|
||||
</div>
|
||||
<div className="panel-header-right">
|
||||
{sessionId && (
|
||||
<button
|
||||
type="button"
|
||||
className="button ghost small"
|
||||
onClick={onEndSession}
|
||||
title="End session"
|
||||
>
|
||||
<Square size={12} />
|
||||
End
|
||||
</button>
|
||||
)}
|
||||
<div className="setup-stream">
|
||||
<select
|
||||
className="setup-select-small"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue