'use client';

import { Badge } from '@/components/ui/badge';
import { cn } from '@/lib/utils';
import { getStatusLabel, getStatusColor, getStatusVariant } from '@/lib/status-utils';

interface StatusBadgeProps {
  status: string;
  className?: string;
  showTooltip?: boolean;
}

export function StatusBadge({ status, className, showTooltip = false }: StatusBadgeProps) {
  const label = getStatusLabel(status);
  const color = getStatusColor(status);
  const variant = getStatusVariant(status);

  return (
    <Badge
      variant={variant}
      className={cn('px-2 py-0.5 whitespace-nowrap', color, className)}
      title={showTooltip ? `状态: ${label}` : undefined}
    >
      {label}
    </Badge>
  );
}
