'use client'; import { Bot, X } from 'lucide-react'; import type { ReactNode } from 'react'; import { Button, Tooltip, TooltipContent, TooltipTrigger, } from '@djangocfg/ui-core/components'; import { cn } from '@djangocfg/ui-core/lib'; export interface ChatHeaderProps { /** Window title text. */ title?: ReactNode; /** Icon next to the title. Defaults to a bot glyph. */ icon?: ReactNode; /** * Action slot — appears to the right of the title, before the close button. * Use for reset / settings / minimize / etc. Compose with `ChatHeaderActionButton`. */ actions?: ReactNode; /** Show the close (×) button. @default true */ showClose?: boolean; /** Close click handler. */ onClose?: () => void; /** ARIA label + tooltip for the close button. @default 'Close' */ closeLabel?: string; /** Replace the close button entirely (rare — most hosts want the default). */ closeSlot?: ReactNode; /** Extra classes on the `
` element. */ className?: string; } /** * Standalone chat header — title + icon + action slot + close button. * * Used by `` automatically, but can be rendered standalone when * the host owns the chat container (e.g. embedded inline in a page). */ export function ChatHeader({ title, icon, actions, showClose = true, onClose, closeLabel = 'Close', closeSlot, className, }: ChatHeaderProps) { return (
{icon ?? } {title}
{actions} {closeSlot ?? (showClose && onClose && ( {closeLabel} ))}
); }