import { StatusBadge } from '@/ui/StatusBadge';
import React from 'react';

interface RaceStatusBadgeProps {
  status: 'scheduled' | 'running' | 'completed' | 'cancelled' | string;
}

export function RaceStatusBadge({ status }: RaceStatusBadgeProps) {
  const config: Record<string, { variant: 'info' | 'success' | 'neutral' | 'warning'; label: string }> = {
    scheduled: {
      variant: 'info',
      label: 'SCHEDULED',
    },
    running: {
      variant: 'success',
      label: 'LIVE',
    },
    completed: {
      variant: 'neutral',
      label: 'COMPLETED',
    },
    cancelled: {
      variant: 'warning',
      label: 'CANCELLED',
    },
  };

  const badgeConfig = config[status] || {
    variant: 'neutral',
    label: status.toUpperCase(),
  };

  return (
    <StatusBadge variant={badgeConfig.variant}>
      {badgeConfig.label}
    </StatusBadge>
  );
}
