diff --git a/ui/src/components/ChatMessageActions.tsx b/ui/src/components/ChatMessageActions.tsx new file mode 100644 index 00000000..92d59380 --- /dev/null +++ b/ui/src/components/ChatMessageActions.tsx @@ -0,0 +1,58 @@ +import { Pencil, RefreshCw } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; + +interface ChatMessageActionsProps { + role: "user" | "assistant" | "system"; + isStreaming?: boolean; + onEdit?: () => void; + onRetry?: () => void; +} + +export function ChatMessageActions({ role, isStreaming, onEdit, onRetry }: ChatMessageActionsProps) { + if (isStreaming) return null; + + if (role === "user" && onEdit) { + return ( +
+ + + + + Edit message + +
+ ); + } + + if (role === "assistant" && onRetry) { + return ( +
+ + + + + Retry response + +
+ ); + } + + return null; +} diff --git a/ui/src/components/ChatStopButton.tsx b/ui/src/components/ChatStopButton.tsx new file mode 100644 index 00000000..e2516347 --- /dev/null +++ b/ui/src/components/ChatStopButton.tsx @@ -0,0 +1,23 @@ +import { Square } from "lucide-react"; +import { Button } from "@/components/ui/button"; + +interface ChatStopButtonProps { + onStop: () => void; +} + +export function ChatStopButton({ onStop }: ChatStopButtonProps) { + return ( +
+ +
+ ); +}