brackt/app/components/standings/TeamScoreBreakdown.tsx

287 lines
11 KiB
TypeScript
Raw Normal View History

import { useState } from "react";
import { Link } from "react-router";
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
import { Card, CardContent } from "~/components/ui/card";
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from "~/components/ui/table";
import { Badge } from "~/components/ui/badge";
interface TeamScoreBreakdownProps {
leagueId: string;
seasonId: string;
numTeams: number;
breakdown: {
team: {
id: string;
name: string;
} | null;
picks: Array<{
pickNumber: number;
round: number;
participant: {
id: string;
name: string;
sport: string;
sportsSeasonId: string;
};
finalPosition: number | null;
points: number;
projectedPoints: number | null;
isComplete: boolean;
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
isPartialScore: boolean;
}>;
actualPoints: number;
projectedPoints: number;
completedCount: number;
totalCount: number;
};
standing: {
currentRank: number;
} | null;
}
type SortColumn = "pick" | "points" | "sport" | "participant";
type SortDirection = "asc" | "desc";
function SortIndicator({ column, sortColumn, sortDirection }: { column: SortColumn; sortColumn: SortColumn; sortDirection: SortDirection }) {
if (sortColumn !== column) return <ArrowUpDown className="ml-1 h-3 w-3 text-muted-foreground/40" />;
return sortDirection === "asc"
? <ArrowUp className="ml-1 h-3 w-3" />
: <ArrowDown className="ml-1 h-3 w-3" />;
}
function SortableHeader({ column, label, sortColumn, sortDirection, onSort, className }: {
column: SortColumn;
label: string;
sortColumn: SortColumn;
sortDirection: SortDirection;
onSort: (column: SortColumn) => void;
className?: string;
}) {
return (
<button
onClick={() => onSort(column)}
aria-sort={sortColumn === column ? (sortDirection === "asc" ? "ascending" : "descending") : "none"}
className={`flex items-center hover:text-foreground cursor-pointer ${className ?? ""}`}
>
{label}<SortIndicator column={column} sortColumn={sortColumn} sortDirection={sortDirection} />
</button>
);
}
const cmp = (a: string, b: string) => a.localeCompare(b, undefined, { sensitivity: "base" });
function sortPicks(
picks: TeamScoreBreakdownProps["breakdown"]["picks"],
sortColumn: SortColumn,
sortDirection: SortDirection,
) {
const dir = sortDirection === "asc" ? 1 : -1;
return picks.toSorted((a, b) => {
if (sortColumn === "pick") {
return (a.pickNumber - b.pickNumber) * dir;
}
if (sortColumn === "sport") {
const sportCmp = cmp(a.participant.sport, b.participant.sport) * dir;
if (sportCmp !== 0) return sportCmp;
return cmp(a.participant.name, b.participant.name) * dir;
}
if (sortColumn === "participant") {
return cmp(a.participant.name, b.participant.name) * dir;
}
// points: sort by actual first, then projected
const pointsDiff = a.points - b.points;
if (pointsDiff !== 0) return pointsDiff * dir;
const aProjected = a.projectedPoints ?? 0;
const bProjected = b.projectedPoints ?? 0;
return (aProjected - bProjected) * dir;
});
}
/**
* Display detailed team score breakdown with all drafted participants
* Phase 4.3: Team breakdown pages
*/
export function TeamScoreBreakdown({
leagueId,
seasonId,
numTeams,
breakdown,
standing,
}: TeamScoreBreakdownProps) {
const [sortColumn, setSortColumn] = useState<SortColumn>("pick");
const [sortDirection, setSortDirection] = useState<SortDirection>("asc");
if (!breakdown.team) {
return (
<div className="text-center text-muted-foreground py-8">
Team not found
</div>
);
}
const remaining = breakdown.totalCount - breakdown.completedCount;
function handleSort(column: SortColumn) {
if (sortColumn === column) {
setSortDirection(sortDirection === "asc" ? "desc" : "asc");
} else {
setSortColumn(column);
setSortDirection(column === "points" ? "desc" : "asc");
}
}
const allPicks = sortPicks(breakdown.picks, sortColumn, sortDirection);
return (
<div className="space-y-6">
{/* Header */}
<div className="flex items-start justify-between">
<div>
<h1 className="text-3xl font-bold">{breakdown.team.name}</h1>
<p className="text-muted-foreground mt-1">Team Score Breakdown</p>
</div>
<div className="text-right">
<div className="text-4xl font-bold text-primary">
{breakdown.actualPoints.toFixed(2)}
</div>
<div className="text-sm text-muted-foreground">Actual Points</div>
{breakdown.projectedPoints > breakdown.actualPoints && (
Redesign to dark-mode-only with navy palette and accent colors (#13) Removes light mode entirely in favour of a permanent dark theme with a navy-tinted background and three signature accents (electric blue, amber/gold, coral) exposed as CSS custom properties and Tailwind utilities (bg-electric, text-amber-accent, text-coral-accent). - Set class="dark" on <html> and apply Clerk dark base theme - Rewrite app.css: single :root palette (oklch navy values), custom --electric / --amber-accent / --coral-accent variables, remove duplicate .dark block and light-mode bg-white/bg-gray-950 rule - Install @clerk/themes for Clerk dark modal support - Replace hardcoded Tailwind colors across 30+ files: - Draft grid cells: blue-50/blue-950 → electric/15, green-50/950 → emerald/10 - Timer: green-600/yellow-600/red-600 → emerald-400/amber-accent/coral-accent - Status badges: blue-50/green-50/gray-50 → electric/emerald/muted variants - Success messages: green-500/15 text-green-700 dark:text-green-400 → emerald-500/15 text-emerald-400 - Info cards: blue-50 dark:bg-blue-950 → electric/10 - Warning cards: yellow-500 → amber-accent variants - Medal/placement badges: yellow-500/orange-600 → amber-accent/coral-accent - Movement indicators: green-600/red-600 → emerald-400/coral-accent - Connection dots: green-500/red-500 → emerald-500/coral-accent - Remove dark:hidden/dark:block logo toggle in welcome.tsx (always dark) - Update DraftGrid test assertions to match new class names Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 19:26:11 -08:00
<div className="text-xl font-semibold text-electric mt-1">
{breakdown.projectedPoints.toFixed(2)}
<span className="text-xs text-muted-foreground ml-1">projected</span>
</div>
)}
{remaining > 0 && (
<div className="text-sm text-muted-foreground mt-1">
{remaining} participant{remaining !== 1 ? "s" : ""} remaining
</div>
)}
{standing && (
<Badge className="mt-2" variant={standing.currentRank <= 3 ? "default" : "outline"}>
Rank #{standing.currentRank}
</Badge>
)}
</div>
</div>
{/* All picks — single flat table */}
<Card>
<CardContent className="pt-4">
<Table>
<TableHeader>
<TableRow>
<TableHead className="min-w-[90px]">
<SortableHeader column="pick" label="Pick #" sortColumn={sortColumn} sortDirection={sortDirection} onSort={handleSort} />
</TableHead>
<TableHead>
<SortableHeader column="sport" label="Sport" sortColumn={sortColumn} sortDirection={sortDirection} onSort={handleSort} />
</TableHead>
<TableHead>
<SortableHeader column="participant" label="Participant" sortColumn={sortColumn} sortDirection={sortDirection} onSort={handleSort} />
</TableHead>
<TableHead className="text-center">Position</TableHead>
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
<TableHead className="text-right">
<button
onClick={() => handleSort("points")}
aria-sort={sortColumn === "points" ? (sortDirection === "asc" ? "ascending" : "descending") : "none"}
className="flex flex-col items-end ml-auto hover:text-foreground cursor-pointer"
>
<div className="flex items-center">
Points<SortIndicator column="points" sortColumn={sortColumn} sortDirection={sortDirection} />
</div>
<div className="text-xs font-normal text-muted-foreground">actual / projected</div>
</button>
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{allPicks.map((pick) => (
<TableRow key={pick.pickNumber}>
<TableCell className="text-muted-foreground">
{numTeams > 0
? `${pick.round}.${String(pick.pickNumber - (pick.round - 1) * numTeams).padStart(2, "0")}`
: `#${pick.pickNumber}`}
<span className="text-xs ml-1">(#{pick.pickNumber})</span>
</TableCell>
<TableCell>
<Link
to={`/leagues/${leagueId}/sports-seasons/${pick.participant.sportsSeasonId}`}
className="text-sm font-medium hover:underline text-primary"
>
{pick.participant.sport}
</Link>
</TableCell>
<TableCell className="font-medium">
{pick.participant.name}
</TableCell>
<TableCell className="text-center">
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
{pick.isComplete && !pick.isPartialScore ? (
(pick.finalPosition ?? 0) === 0 ? (
<Badge variant="secondary">Did Not Score</Badge>
) : (
Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) * Fix no-shadow and consistent-function-scoping lint violations Resolves all 11 no-shadow and 16 consistent-function-scoping oxlint warnings and promotes both rules to errors in .oxlintrc.json. no-shadow: renamed Drizzle callback params (sports→s, matches→m, seasons→s) to avoid shadowing outer imports; removed shadowed destructures (eq, inArray) from where callbacks; renamed inner template→bracketTemplate, prev→currentTimers, season→ss, name→teamName (with name: teamName fix to preserve semantics). consistent-function-scoping: moved formatDate, getRankBadge, getMovementIndicator, getPositionBadge, getStatusBadge, toDateStr, elo (×2), weightedPick, sortByMatchNumber (×2) to module scope; moved formatTime (×2), isValidLeagueName, getDraftTimes, makeSeasonQueues to file scope in test files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix no-non-null-assertion lint violations and promote to error Eliminates all 208 no-non-null-assertion warnings across 38 files. Promotes typescript/no-non-null-assertion from warn to error in .oxlintrc.json. Fix patterns applied: - Map.get(key)! after .has() check → extract with get() + null guard - Map.get(key)! on pre-populated count maps → ?? 0 default - .set(id, map.get(id)! + 1) increment → ?? 0 before adding - participant1Id!/participant2Id! on DB matches → ?? "" fallback - array.find()! in tests → guard + throw or expect().toBeDefined() - bracketTemplateCache.get(id)! → null guard extract - Various nullable field accesses → optional chain or ?? default Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix prefer-add-event-listener, no-unassigned-import, require-module-specifiers Resolves all 9 remaining non-console lint warnings and promotes all three rules to errors in .oxlintrc.json. - prefer-add-event-listener: converted onchange/onclick/onload assignments to addEventListener in useDraftNotifications.ts and admin.data-sync.tsx; stored changeHandler ref for proper cleanup with removeEventListener - no-unassigned-import: configured rule with allow list for legitimate side-effect imports (*.css, @testing-library/jest-dom, @testing-library/cypress/add-commands) - require-module-specifiers: removed redundant `export {}` from cypress/support/e2e.ts (file already has an import) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix TypeScript errors from no-non-null-assertion fixes Two fixes introduced by the non-null assertion cleanup produced type errors: - scoring-event.ts: `?? ""` was wrong type for a participant object map; restructured to explicit null guards so TypeScript can narrow correctly - standings-sync/index.ts: `?? null` after name-match lookup lost the truthy guarantee, causing TS18047 on the write-back block; added `participant &&` guard before accessing its properties Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add npm run typecheck as Stop hook in Claude settings Runs a full project typecheck at the end of each Claude turn so type errors surface as feedback before the next message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 10:59:51 -07:00
<PlacementBadge position={pick.finalPosition ?? 0} />
)
) : (
<Badge variant="outline">Pending</Badge>
)}
</TableCell>
<TableCell className="text-right">
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
{pick.isComplete && !pick.isPartialScore ? (
<span className="font-semibold">
{pick.points > 0 ? pick.points.toFixed(2) : "0.00"}
</span>
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
) : (
<div className="flex flex-col items-end">
Fix bracket point averaging and partial-score display in standings/breakdown (#159) * Fix bracket point averaging and partial-score display in standings/breakdown Bracket sports (UCL, NBA, NFL, etc.) use averaged points for tied positions (e.g. QF losers all share avg of 5th-8th = 20 pts), but both calculateTeamProjectedScore and getTeamScoreBreakdown were using raw pointsFor5th (25) instead of the bracket-averaged value. This caused the team breakdown page to show incorrect actual points (25 vs 20) and the standings page to show incorrect actualPoints/projectedPoints totals. Additionally, participants with isPartialScore=true (still alive in a bracket with a provisional floor position) were being displayed with a final placement badge (e.g. "5th") instead of "Pending". Changes: - calculateTeamProjectedScore: use calculateBracketPoints for bracket sports; handle isPartialScore participants separately (floor in actualPoints, incremental EV in projectedPoints, Math.max guard for EV < floor edge case) - getTeamScoreBreakdown: same bracket averaging fix; pass isPartialScore through to picks; use explicit finalPosition != null && > 0 check - TeamScoreBreakdown component: show Pending badge for isPartialScore participants; display actual/floor + EV row for all incomplete picks; add "actual / projected" column header subtitle - 9 new unit tests covering all scoring branches including the EV-below- floor clamp edge case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix typecheck: cast DUMMY_EV_ROW to any in test fixture ParticipantEV has additional required fields (id, participantId, etc.) that aren't needed for the mock — cast to any to satisfy the type checker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:00:32 -07:00
<span className="font-semibold">{pick.points.toFixed(2)}</span>
{pick.projectedPoints !== null && (
<span className="text-xs text-muted-foreground">
{pick.projectedPoints.toFixed(2)}
</span>
)}
</div>
)}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</CardContent>
</Card>
{/* Navigation */}
<div className="flex justify-between pt-4">
<Link
to={`/leagues/${leagueId}/standings/${seasonId}`}
className="inline-flex items-center text-sm text-muted-foreground hover:text-foreground"
>
Back to Standings
</Link>
</div>
</div>
);
}
/**
* Display placement badge with color coding
*/
function PlacementBadge({ position }: { position: number }) {
const badges: Record<number, { label: string; className: string }> = {
Redesign to dark-mode-only with navy palette and accent colors (#13) Removes light mode entirely in favour of a permanent dark theme with a navy-tinted background and three signature accents (electric blue, amber/gold, coral) exposed as CSS custom properties and Tailwind utilities (bg-electric, text-amber-accent, text-coral-accent). - Set class="dark" on <html> and apply Clerk dark base theme - Rewrite app.css: single :root palette (oklch navy values), custom --electric / --amber-accent / --coral-accent variables, remove duplicate .dark block and light-mode bg-white/bg-gray-950 rule - Install @clerk/themes for Clerk dark modal support - Replace hardcoded Tailwind colors across 30+ files: - Draft grid cells: blue-50/blue-950 → electric/15, green-50/950 → emerald/10 - Timer: green-600/yellow-600/red-600 → emerald-400/amber-accent/coral-accent - Status badges: blue-50/green-50/gray-50 → electric/emerald/muted variants - Success messages: green-500/15 text-green-700 dark:text-green-400 → emerald-500/15 text-emerald-400 - Info cards: blue-50 dark:bg-blue-950 → electric/10 - Warning cards: yellow-500 → amber-accent variants - Medal/placement badges: yellow-500/orange-600 → amber-accent/coral-accent - Movement indicators: green-600/red-600 → emerald-400/coral-accent - Connection dots: green-500/red-500 → emerald-500/coral-accent - Remove dark:hidden/dark:block logo toggle in welcome.tsx (always dark) - Update DraftGrid test assertions to match new class names Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 19:26:11 -08:00
1: { label: "1st", className: "bg-amber-accent hover:bg-amber-accent/80 text-background" },
2: { label: "2nd", className: "bg-muted hover:bg-muted/80 text-muted-foreground" },
3: { label: "3rd", className: "bg-coral-accent hover:bg-coral-accent/80 text-background" },
4: { label: "4th", className: "bg-electric/20 hover:bg-electric/30 text-electric" },
5: { label: "5th", className: "bg-purple-500/20 hover:bg-purple-500/30 text-purple-400" },
6: { label: "6th", className: "bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-400" },
7: { label: "7th", className: "bg-pink-500/20 hover:bg-pink-500/30 text-pink-400" },
8: { label: "8th", className: "bg-indigo-500/20 hover:bg-indigo-500/30 text-indigo-400" },
};
const badge = badges[position] || { label: `${position}th`, className: "" };
return (
<Badge className={badge.className}>
{badge.label}
</Badge>
);
}