'use client' import { useState, useEffect } from 'react' import { Button } from '@/components/ui/button' import { ChatPanel } from './ChatPanel' import { MessageCircle, X } from 'lucide-react' import { cn } from '@/lib/utils' import { ENABLED_EXTENSION_IDS } from '@/lib/extensions/_generated/enabled-extensions' const chatEnabled = ENABLED_EXTENSION_IDS.has('ai-chat') export function ChatWidget() { const [isOpen, setIsOpen] = useState(false) // Allow other components to open the chat via custom event useEffect(() => { const handler = () => setIsOpen(true) window.addEventListener('open-ai-chat', handler) return () => window.removeEventListener('open-ai-chat', handler) }, []) if (!chatEnabled) return null return ( <> {/* Floating chat panel */}
{/* Close button in corner */}
{/* Floating action button */} ) }