'use client';

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

export type SessionStatus = 'scheduled' | 'running' | 'completed' | 'cancelled' | 'delayed';

interface SessionStatusBadgeProps {
  status: SessionStatus;
}

export function SessionStatusBadge({ status }: SessionStatusBadgeProps) {
  const config: Record<SessionStatus, { label: string; variant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' }> = {
    scheduled: {
      label: 'SCHEDULED',
      variant: 'primary',
    },
    running: {
      label: 'LIVE',
      variant: 'success',
    },
    completed: {
      label: 'COMPLETED',
      variant: 'default',
    },
    cancelled: {
      label: 'CANCELLED',
      variant: 'danger',
    },
    delayed: {
      label: 'DELAYED',
      variant: 'warning',
    },
  };

  const { label, variant } = config[status] || config.scheduled;

  return (
    <Badge variant={variant} size="sm">
      {label}
    </Badge>
  );
}
