import Link from 'next/link'; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Progress } from '@/components/ui/progress'; import { Badge } from '@/components/ui/badge'; import { ShiftListItemDto } from '@/hooks/useShifts'; interface ShiftCardProps { shift: ShiftListItemDto; } export function ShiftCard({ shift }: ShiftCardProps) { const capacityPercentage = (shift.currentSignups / shift.capacity) * 100; const isFull = shift.currentSignups >= shift.capacity; const isPast = new Date(shift.startTime) < new Date(); return (
{shift.title} {isPast && Past}
{new Date(shift.startTime).toLocaleString()} - {new Date(shift.endTime).toLocaleTimeString()}
Capacity {shift.currentSignups}/{shift.capacity} spots filled
{!isPast && !isFull && ( )}
); }