"use client"; import { useEffect, useMemo, useState } from "react"; import { ArrowLeft, Sparkles } from "lucide-react"; import { Button } from "@/components/ui/button"; import { AIAssistantInterface } from "@/components/ZoeIA/ai-assistant-interface"; interface HistoryEntry { id: string; text: string; createdAt: string; } export function ChatWidget() { const [assistantOpen, setAssistantOpen] = useState(false); const [history, setHistory] = useState([]); useEffect(() => { if (!assistantOpen) return; const original = document.body.style.overflow; document.body.style.overflow = "hidden"; return () => { document.body.style.overflow = original; }; }, [assistantOpen]); const gradientRing = useMemo( () => ( ), [] ); const openAssistant = () => setAssistantOpen(true); const closeAssistant = () => setAssistantOpen(false); const handleOpenDocuments = () => { console.log("[ChatWidget] Abrindo fluxo de documentos"); closeAssistant(); }; const handleOpenChat = () => { console.log("[ChatWidget] Encaminhando para chat humano"); closeAssistant(); }; const handleAddHistory = (entry: HistoryEntry) => { setHistory((prev) => [...prev, entry]); }; const handleClearHistory = () => { setHistory([]); }; return ( <> {assistantOpen && (
)}
); }