import Link from 'next/link'; import { getCourtColor } from '../utils/bookingUtils'; import { SlotStatus } from '../lib/types'; import useTranslation from '../hooks/useTranslation'; interface CourtCardHeaderProps { courtName?: string; timeDisplay?: string; playerCount: number; status: SlotStatus | string; players?: any[]; isOngoing?: boolean; linkHref?: string; viewMode?: 'timeline' | 'court'; } export default function CourtCardHeader({ courtName, timeDisplay, playerCount, status, players = [], isOngoing = false, linkHref, viewMode = 'timeline' }: CourtCardHeaderProps) { const { t } = useTranslation(); const displayText = viewMode === 'timeline' ? courtName : timeDisplay; return (
{/* Court name or time on the left */} {linkHref ? ( {displayText} ) : ( {displayText} )} {/* Player count with status indicator in center */}
{t('{count}/4 players', { count: String(playerCount) })}
{/* Status badge on the right */} {t(status as 'available' | 'pending' | 'booked' | 'coach')}
); }