'use client'; /** * Chat Suggestions Component * * A categorized suggestion strip above the chat input. * Shows tabs for categories and clickable chips with example sentences. * * Features: * - Minimizable after first message * - Click to fill input (not send) * - Contextual patient name replacement */ import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ChevronDown, ChevronUp, Lightbulb } from 'lucide-react'; import { cn } from '@/lib/utils'; import { SUGGESTION_CATEGORIES, replacePlaceholder } from '@/lib/cortex/suggestions'; interface ChatSuggestionsProps { /** Whether the strip should be minimized */ isMinimized: boolean; /** Callback when minimized state changes */ onToggleMinimize: () => void; /** Callback when a suggestion is clicked */ onSelectSuggestion: (text: string) => void; /** Optional active patient name to replace [naam] placeholders */ activePatientName?: string; } export function ChatSuggestions({ isMinimized, onToggleMinimize, onSelectSuggestion, activePatientName, }: ChatSuggestionsProps) { const [activeCategory, setActiveCategory] = useState(SUGGESTION_CATEGORIES[0].id); const currentCategory = SUGGESTION_CATEGORIES.find((c) => c.id === activeCategory); const handleChipClick = (text: string, hasPlaceholder?: boolean) => { // Replace placeholder with patient name if available, otherwise keep placeholder const finalText = hasPlaceholder ? replacePlaceholder(text, activePatientName) : text; onSelectSuggestion(finalText); }; return (
{currentCategory.description}
)}