import React from 'react'; import { HomeIcon, Maximize2Icon, Minimize2Icon, PlusIcon, XIcon, } from 'lucide-react'; import type { ICopilotThreadSummary } from '../../../service/copilot/copilot.interface'; import { Button } from '../../ui/button'; import { ThreadSwitcher } from '../ThreadSwitcher'; /** * The docked panel's header: the mark, the conversation being read, and the * four things that can be done to the panel itself. * * @param props - Component props. * @param props.logo - The plugin icon WordPress localized, when there is one. * @param props.threads - The merchant's saved conversations. * @param props.activeThreadId - The one open, when it has been saved. * @param props.canStartNew - There is a conversation to leave behind. * @param props.isWide - The panel is at its wider width. * @param props.onHome - Go back to the copilot's home surface. * @param props.onNew - Start a new conversation. * @param props.onOpenThread - Open a saved conversation. * @param props.onDeleteThread - Delete one. * @param props.onRenameThread - Rename one. * @param props.onToggleWidth - Widen or narrow the panel. * @param props.onClose - Close the panel. * @return The header. */ export function PanelHeader({ logo, threads, activeThreadId, canStartNew, isWide, onHome, onNew, onOpenThread, onDeleteThread, onRenameThread, onToggleWidth, onClose, }: { logo: string; threads: ICopilotThreadSummary[]; activeThreadId: string | null; canStartNew: boolean; isWide: boolean; onHome: () => void; onNew: () => void; onOpenThread: (threadId: string) => void; onDeleteThread: (threadId: string) => void; onRenameThread: (threadId: string, title: string) => void; onToggleWidth: () => void; onClose: () => void; }): React.ReactElement { return (
{logo ? ( Recomaze ) : ( R )}
{canStartNew && ( )}
); }