import { type JSX, Show, splitProps } from 'solid-js'; import { cn } from '../utils/cn'; export type StatusKind = 'new' | 'online' | 'busy' | 'away' | 'offline'; /** status → background hue utility (backed by the kit's tool-* / muted tokens). */ export const STATUS_BG: Record = { new: 'bg-tool-blue', online: 'bg-tool-green', busy: 'bg-tool-red', away: 'bg-tool-amber', offline: 'bg-muted-foreground', }; const SIZE: Record<'sm' | 'md', string> = { sm: 'size-2', md: 'size-2.5' }; export interface StatusProps extends JSX.HTMLAttributes { status?: StatusKind; size?: 'sm' | 'md'; /** Add an animated ping ring (disabled under prefers-reduced-motion). */ pulse?: boolean; /** Accessible name. With it, the dot is announced; without it, it is decorative. */ label?: string; } export function Status(props: StatusProps) { const [local, rest] = splitProps(props, ['status', 'size', 'pulse', 'label', 'class']); const kind = () => local.status ?? 'new'; return ( ); }