import Link from "next/link"; import { matchesByDate, matchPhase, type MatchPhase } from "@/lib/schedule"; import { getPredictions, getCrowd } from "@/lib/mockData"; import { dateHeading, timeOnly } from "@/lib/format"; import { type Lang, dict, teamShort, roundLabel as tRound } from "@/lib/i18n"; import type { Match } from "@/lib/types"; import TeamFlag from "./TeamFlag"; const STROKE = "#94FBE0"; // 일정 텍스트·선택 아웃라인 스트로크 컬러 const PHASE_CLS: Record = { open: "border-[#94FBE0] text-[#94FBE0]", scheduled: "border-[var(--line-d)] text-[var(--ink-muted)]", locked: "border-[var(--line-d)] text-[var(--ink-muted)]", finished: "border-white/15 text-white/55", }; export default function ScheduleBoard({ lang = "ko" }: { lang?: Lang }) { const t = dict(lang); const groups = matchesByDate(); return (

{t.schedTitle}

{t.schedGuide}
{groups.map((g) => (
{dateHeading(g.date, lang)}
{g.matches.map((m) => ( ))}
))}
); } function MatchCard({ match, lang }: { match: Match; lang: Lang }) { const t = dict(lang); const phase = matchPhase(match); const preds = getPredictions(match, lang); const crowd = getCrowd(match); // AI 픽 갈림 요약 const tally = { a: 0, d: 0, b: 0 }; for (const p of preds) { if (p.outcome === "TEAM_A_WIN") tally.a++; else if (p.outcome === "DRAW") tally.d++; else tally.b++; } const split: string[] = []; if (tally.a) split.push(`${teamShort(match.teamA, lang)} ${tally.a}`); if (tally.d) split.push(`${t.draw} ${tally.d}`); if (tally.b) split.push(`${teamShort(match.teamB, lang)} ${tally.b}`); const href = `/match/${match.matchId}${lang === "en" ? "?lang=en" : ""}`; return (
{timeOnly(match.kickoffKst)} KST ·{" "} {tRound(match.roundLabel, lang)} {t.phase[phase]}
{teamShort(match.teamA, lang)}
VS
{teamShort(match.teamB, lang)}
{t.aiPicks} {split.join(" · ")} {t.joined(crowd.total.toLocaleString())}
); }