"use client";

interface ConnectionBadgeProps {
  llmProxyReachable: boolean;
  loading: boolean;
}

export function ConnectionBadge({
  llmProxyReachable,
  loading,
}: ConnectionBadgeProps) {
  if (loading) {
    return (
      <span
        className="inline-block w-2 h-2 rounded-full bg-rp-muted opacity-60"
        title="Connecting..."
      />
    );
  }

  if (llmProxyReachable) {
    return (
      <span
        className="inline-block w-2 h-2 rounded-full bg-rp-success"
        title="LLM connected"
      />
    );
  }

  return (
    <span
      className="inline-block w-2 h-2 rounded-full bg-rp-warning"
      title="LLM unreachable"
    />
  );
}
