/** * Capacity Display Component * * Shows booking capacity in "booked_count / capacity · remaining" format. * Provides visual feedback for slot availability. */ import type { BookingSlot } from '@/src/types/bookings'; interface CapacityDisplayProps { slot: Pick; variant?: 'default' | 'compact' | 'inline'; className?: string; } export default function CapacityDisplay({ slot, variant = 'default', className = '', }: CapacityDisplayProps) { const { booked_count, capacity, capacity_remaining } = slot; // Determine color based on availability const availabilityColor = capacity_remaining === 0 ? 'text-red-600' : capacity_remaining <= 1 ? 'text-orange-600' : 'text-slate-700'; if (variant === 'compact') { return ( {booked_count} / {capacity} ); } if (variant === 'inline') { return ( {booked_count} / {capacity} booked · {capacity_remaining} remaining ); } return (
{booked_count} / {capacity} booked

{capacity_remaining} {capacity_remaining === 1 ? 'spot' : 'spots'} remaining

); }