"use client"; import { Braces, ChevronLeft, MoreVertical, Pencil, Settings2, Share2, Wand2, } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { AgentPreviewPanel } from "./agent-preview-panel"; import { AgentThread } from "./agent-thread"; import { ChatComposer } from "./chat-composer"; import { ChatEmptyState } from "./chat-empty-state"; import { agentFadeIn, agentLayoutTransition, } from "./agent-motion"; import { AGENT_BREADCRUMB, AGENT_WORKSPACE_TITLE, } from "./playground-content"; import type { ChatMessage } from "./types"; import type { ToolsTab } from "./playground-tools-sheet"; import { cn } from "@/lib/utils"; import { type } from "@/lib/typography"; interface ChatPanelProps { messages: ChatMessage[]; inputValue: string; onInputChange: (value: string) => void; onSubmit: () => void; onStarterSelect: (id: string, prompt: string) => void; onOpenTools: (tab: ToolsTab) => void; isSending?: boolean; isTyping?: boolean; bottomRef?: React.RefObject; className?: string; } function AgentHeader({ onOpenTools, }: { onOpenTools: (tab: ToolsTab) => void; }) { return (
{AGENT_BREADCRUMB.parent} {AGENT_BREADCRUMB.current}

{AGENT_WORKSPACE_TITLE}

); } export function ChatPanel({ messages, inputValue, onInputChange, onSubmit, onStarterSelect, onOpenTools, isSending = false, isTyping = false, bottomRef, className, }: ChatPanelProps) { const showEmptyState = messages.length === 0 && !isTyping; const showPreview = messages.length > 0 || isTyping; return (
{showEmptyState ? ( ) : ( )}
{showPreview && ( )}
); }