'use client';

import { useTranslations } from 'next-intl';
import { Badge } from '@/components/ui/shared/Badge';
import { isLabGeneratedCase } from '@/components/lab/labCaseOrigin';

interface LabCaseOriginBadgeProps {
  origin?: string | null;
  className?: string;
}

export function LabCaseOriginBadge({ origin, className }: LabCaseOriginBadgeProps) {
  const t = useTranslations('cases');
  const generated = isLabGeneratedCase(origin);

  return (
    <Badge
      variant={generated ? 'default' : 'success'}
      fixedWidth={false}
      className={className}
    >
      {generated ? t('generatedBadge') : t('receivedBadge')}
    </Badge>
  );
}
