All files / client/src/components/ui status-dot.tsx

100% Statements 1/1
100% Branches 3/3
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                            52x                          
import { cn } from "@/lib/utils";
import {
  getStatusBackgroundClass,
  type ApplicationStatus,
} from "@/lib/status-semantics";
 
interface StatusDotProps {
  readonly status: ApplicationStatus;
  readonly label: string;
  readonly pulse?: boolean;
}
 
/** Passive, labeled status marker for compact textual status rows. */
export function StatusDot({ status, label, pulse = false }: StatusDotProps) {
  return (
    <span
      title={label}
      className={cn(
        "inline-flex h-2 w-2 shrink-0 rounded-full cursor-default",
        getStatusBackgroundClass(status),
        pulse && "animate-pulse",
      )}
    >
      <span className="sr-only">{label}</span>
    </span>
  );
}