import { IconLayoutList, IconPin, IconPinned, IconTrash, IconX } from "@tabler/icons-react"; import { useId } from "react"; import { useTranslation } from "react-i18next"; import { Button } from "@kandev/ui"; import { Switch } from "@kandev/ui/switch"; import { cn } from "@/lib/utils"; import { useResponsiveBreakpoint } from "@/hooks/use-responsive-breakpoint"; export type QueuePanelHeaderProps = { count: number; max: number; isFull: boolean; autoRun: boolean; isLoading: boolean; cancellationPending: boolean; pinned: boolean; onClear: () => void; onAutoRunChange: (enabled: boolean) => void; onTogglePin: () => void; onClose: () => void; }; export function QueuePanelHeader({ count, max, isFull, autoRun, isLoading, cancellationPending, pinned, onClear, onAutoRunChange, onTogglePin, onClose, }: QueuePanelHeaderProps) { const { t } = useTranslation(); const autoRunId = useId(); const autoRunHelpId = `${autoRunId}-help`; // The pin is a desktop-only convenience: on phone viewports the queue panel // keeps its existing controls and the pin is not rendered. const { isMobile } = useResponsiveBreakpoint(); const capacityText = max > 0 ? t(isFull ? "chat:queueCapacityFull" : "chat:queueCapacity", { count, max }) : t("chat:queueCount", { count }); return (