From b642c5be8b0437724db3188375a4aa1e3a05a709 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:00:01 +0000 Subject: [PATCH] Add clear chat button Add a button to clear the chat conversation on the Test Agent screen. This button will also trigger a toast notification to confirm the action. --- src/pages/TestPrompt.tsx | 56 ++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/src/pages/TestPrompt.tsx b/src/pages/TestPrompt.tsx index b59a683..b70737e 100644 --- a/src/pages/TestPrompt.tsx +++ b/src/pages/TestPrompt.tsx @@ -4,7 +4,8 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { ScrollArea } from "@/components/ui/scroll-area"; -import { Send, Bot, User } from "lucide-react"; +import { Send, Bot, User, RotateCcw } from "lucide-react"; +import { useToast } from "@/hooks/use-toast"; import { Select, SelectContent, @@ -25,6 +26,7 @@ export default function TestPrompt() { const [isLoading, setIsLoading] = useState(false); const [selectedAgent, setSelectedAgent] = useState(""); const scrollRef = useRef(null); + const { toast } = useToast(); // Mock data de agentes const agents = [ @@ -76,6 +78,14 @@ export default function TestPrompt() { } }; + const handleClearChat = () => { + setMessages([]); + toast({ + title: "Conversa limpa", + description: "O histórico de mensagens foi limpo com sucesso.", + }); + }; + return (
@@ -88,21 +98,35 @@ export default function TestPrompt() { {/* Selector de Agente */}
- - +
+
+ + +
+ +
{/* Chat Area */}