"use client";

import { cn } from "@/lib/utils";
import { getLatencyLevel, latencyColors } from "./constants";

interface LatencyIndicatorProps {
  latencyMs: number;
  className?: string;
}

export function LatencyIndicator({ latencyMs, className }: LatencyIndicatorProps) {
  const level = getLatencyLevel(latencyMs);
  const color = latencyColors[level];

  return (
    <span className={cn("font-mono text-sm", color, className)}>
      {latencyMs}ms
    </span>
  );
}
