import { cn } from "../lib/utils" export type StatusTone = "positive" | "info" | "warning" | "negative" | "neutral" const toneClass: Record = { positive: "bg-success-soft text-success border-success/20", info: "bg-info-soft text-info border-info/20", warning: "bg-warning-soft text-warning border-warning/30", negative: "bg-coral-soft text-coral border-coral/25", neutral: "bg-muted text-muted-foreground border-border", } const dotClass: Record = { positive: "bg-success", info: "bg-info", warning: "bg-warning", negative: "bg-coral", neutral: "bg-muted-foreground/60", } /** * Цветная точка статуса — во вкладках, списках, рядом с подписью. * `pulse` — мигает: идёт процесс («подключение», «ожидание связи»). */ export function StatusDot({ tone, pulse, className, }: { /** Без тона точка берёт цвет текста. */ tone?: StatusTone pulse?: boolean className?: string }) { return ( ) } const sizeClass = { sm: "gap-1 px-1.5 py-px text-2xs", md: "gap-1.5 px-2 py-0.5 text-xs", lg: "gap-2 px-2.5 py-1 text-sm", } /** * Статус с цветной точкой: «Работает», «Записан», «Неявка»… `pulse` — точка мигает («Подключение…»). * `size="sm"` — в плотных строках таблиц и рядом с мелкими метками, `"lg"` — в шапке карточки или страницы. */ export function StatusBadge({ tone, size = "md", dot = true, pulse, className, children, }: { tone: StatusTone size?: "sm" | "md" | "lg" dot?: boolean pulse?: boolean className?: string children: React.ReactNode }) { return ( {dot && } {children} ) }