"use client"; import { ProtestViewModel } from "../../lib/view-models/ProtestViewModel"; import { RaceViewModel } from "../../lib/view-models/RaceViewModel"; import { DriverViewModel } from "../../lib/view-models/DriverViewModel"; import Card from "../ui/Card"; import Button from "../ui/Button"; import Link from "next/link"; import { AlertCircle, Video, ChevronRight, Flag, Clock, AlertTriangle } from "lucide-react"; interface PendingProtestsListProps { protests: ProtestViewModel[]; races: Record; drivers: Record; leagueId: string; onReviewProtest: (protest: ProtestViewModel) => void; onProtestReviewed: () => void; } export function PendingProtestsList({ protests, races, drivers, leagueId, onReviewProtest, onProtestReviewed, }: PendingProtestsListProps) { if (protests.length === 0) { return (

All Clear! 🏁

No pending protests to review

); } return (
{protests.map((protest) => { const daysSinceFiled = Math.floor((Date.now() - new Date(protest.filedAt || protest.submittedAt).getTime()) / (1000 * 60 * 60 * 24)); const isUrgent = daysSinceFiled > 2; return (

Protest #{protest.id.substring(0, 8)}

Filed {new Date(protest.filedAt || protest.submittedAt).toLocaleDateString()}

Pending {isUrgent && ( {daysSinceFiled}d old )}
Lap {protest.incident?.lap || 'N/A'}

{protest.incident?.description || protest.description}

{protest.proofVideoUrl && (
)}
); })}
); }