website cleanup
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { Protest } from "@gridpilot/racing/domain/entities/Protest";
|
||||
import { Race } from "@gridpilot/racing/domain/entities/Race";
|
||||
import { DriverDTO } from "@gridpilot/racing/application/dto/DriverDTO";
|
||||
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: Protest[];
|
||||
races: Record<string, Race>;
|
||||
drivers: Record<string, DriverDTO>;
|
||||
protests: ProtestViewModel[];
|
||||
races: Record<string, RaceViewModel>;
|
||||
drivers: Record<string, DriverViewModel>;
|
||||
leagueId: string;
|
||||
onReviewProtest: (protest: Protest) => void;
|
||||
onReviewProtest: (protest: ProtestViewModel) => void;
|
||||
onProtestReviewed: () => void;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export function PendingProtestsList({
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
{protests.map((protest) => {
|
||||
const daysSinceFiled = Math.floor((Date.now() - new Date(protest.filedAt).getTime()) / (1000 * 60 * 60 * 24));
|
||||
const daysSinceFiled = Math.floor((Date.now() - new Date(protest.filedAt || protest.submittedAt).getTime()) / (1000 * 60 * 60 * 24));
|
||||
const isUrgent = daysSinceFiled > 2;
|
||||
|
||||
return (
|
||||
@@ -64,7 +64,7 @@ export function PendingProtestsList({
|
||||
Protest #{protest.id.substring(0, 8)}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-400">
|
||||
Filed {new Date(protest.filedAt).toLocaleDateString()}
|
||||
Filed {new Date(protest.filedAt || protest.submittedAt).toLocaleDateString()}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -84,10 +84,10 @@ export function PendingProtestsList({
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2 text-sm">
|
||||
<Flag className="h-4 w-4 text-gray-400" />
|
||||
<span className="text-gray-400">Lap {protest.incident.lap}</span>
|
||||
<span className="text-gray-400">Lap {protest.incident?.lap || 'N/A'}</span>
|
||||
</div>
|
||||
<p className="text-gray-300 line-clamp-2 leading-relaxed">
|
||||
{protest.incident.description}
|
||||
{protest.incident?.description || protest.description}
|
||||
</p>
|
||||
{protest.proofVideoUrl && (
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1.5 text-sm bg-primary-blue/10 text-primary-blue rounded-lg border border-primary-blue/20">
|
||||
|
||||
Reference in New Issue
Block a user