Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion frontend/src/components/match/MatchDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
Play,
ArrowLeft,
Users,
AlertTriangle,
} from "lucide-react";
import { cn } from "@/lib/utils";

Expand All @@ -36,9 +37,52 @@ export function MatchDetailView({
const isWinner = match.winnerId === currentUserId;
const player1Won = match.winnerId === match.player1Id;
const player2Won = match.winnerId === match.player2Id;
const isDisputed = match.status === "disputed";

return (
<div className="space-y-6">
{isDisputed && (
<div className="flex flex-col gap-2 rounded-lg border border-warning/50 bg-warning/10 p-4">
<div className="flex items-center gap-2 text-warning font-semibold text-lg">
<AlertTriangle className="h-5 w-5" />
Under Review
</div>
<p className="text-sm text-muted-foreground">
This match is currently under dispute review. An admin will evaluate
both submitted scores and reach a decision.
</p>
{match.disputeDeadline && (
<p className="text-sm flex items-center gap-2 text-muted-foreground">
<Calendar className="h-4 w-4" />
Dispute deadline:{" "}
<span className="font-medium">
{new Date(match.disputeDeadline).toLocaleString()}
</span>
</p>
)}
<div className="flex items-center gap-4 mt-1">
<div className="flex-1 rounded-md border bg-muted/50 p-3 text-center">
<p className="text-xs text-muted-foreground mb-1">
{match.player1Username}
</p>
<p className="text-2xl font-bold">{match.scorePlayer1 ?? "—"}</p>
</div>
<span className="text-muted-foreground font-medium">vs</span>
<div className="flex-1 rounded-md border bg-muted/50 p-3 text-center">
<p className="text-xs text-muted-foreground mb-1">
{match.player2Username}
</p>
<p className="text-2xl font-bold">{match.scorePlayer2 ?? "—"}</p>
</div>
</div>
<a
href="mailto:support@arenax.gg"
className="text-sm text-primary underline-offset-4 hover:underline mt-1"
>
Contact support
</a>
</div>
)}
<Card>
<CardHeader>
<div className="flex items-center justify-between">
Expand All @@ -60,7 +104,7 @@ export function MatchDetailView({
</Link>
</Button>
)}
{match.canDispute && (
{match.canDispute && !isDisputed && (
<Button variant="outline" size="sm" onClick={onReportIssue}>
<Flag className="h-4 w-4 mr-2" />
Report Issue
Expand Down
Loading