import React from 'react';
import { StatusBadge } from './StatusBadge';

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

export function RaceStatusBadge({ status }: RaceStatusBadgeProps) {
  const config = {
    scheduled: {
      variant: 'info' as const,
      label: 'Scheduled',
    },
    running: {
      variant: 'success' as const,
      label: 'LIVE',
    },
    completed: {
      variant: 'neutral' as const,
      label: 'Completed',
    },
    cancelled: {
      variant: 'warning' as const,
      label: 'Cancelled',
    },
  };

  const badgeConfig = config[status as keyof typeof config] || {
    variant: 'neutral' as const,
    label: status,
  };

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