import { useState, type KeyboardEvent } from "react"; import { ArrowUpRight } from "lucide-react"; import type { DdragonManifest, Position, RiotLane, } from "../../api/types"; import { RankBadge } from "../../components/RankBadge"; import { formatRankDetail } from "../../components/rankBadgeUtils"; import { DEFAULT_COMMUNITY_ID } from "../../config"; import { championDisplayName, championIconUrl, profileIconUrl } from "../../lib/ddragon"; import { internalMatchGamePath } from "../../lib/internal-match-routes"; import { POSITION_ORDER, positionIcon, positionLabel } from "../../lib/league"; import { internalMatches, manifest, profile, snapshot, summaries, type PreviewMatch, type PreviewProfile, type PreviewSnapshot, type PreviewSummary } from "./data"; import "./preview.css"; const MATCH_ID = "6a3b94bccb8a54219653f457"; const USER_ID = "69ed3d75f3a6fd129207196b"; const LANES: Record = { TOP: "TOP", JGL: "JUNGLE", MID: "MIDDLE", ADC: "BOTTOM", SUP: "UTILITY", }; type ProfileTab = "internal" | "solo"; function formatDate(value: string | number | null | undefined) { if (!value) return "기록 없음"; const date = new Date(value); if (Number.isNaN(date.getTime())) return "기록 없음"; return new Intl.DateTimeFormat("ko-KR", { timeZone: "Asia/Seoul", year: "numeric", month: "2-digit", day: "2-digit", }).format(date).replace(/\s/g, "").replace(/\.$/, ""); } function Portrait({ championId, manifest }: { championId: number; manifest: DdragonManifest }) { const src = championIconUrl(manifest, championId); return ( {src && } ); } function PositionExperience({ summary, mainPosition, tab }: { summary: PreviewSummary; mainPosition: Position; tab: ProfileTab; }) { const mainRate = summary.positionRates[LANES[mainPosition]] ?? 0; return (

실제 플레이 포지션

최근 {summary.windowSize}경기
{POSITION_ORDER.map(position => { const rate = summary.positionRates[LANES[position]] ?? 0; const games = Math.round(summary.windowSize * rate / 100); return (
0} key={position}>
{positionLabel[position]}
{games}경기
); })}
{summary.windowSize > 0 && mainRate === 0 && (

신청 1순위는 {positionLabel[mainPosition]} · 최근 {tab === "solo" ? "솔로랭크" : "내전"}에서 해당 포지션 기록은 없습니다.

)}
); } function Metrics({ summary }: { summary: PreviewSummary }) { return (
승률{summary.winRate}%

{summary.wins}승 {summary.losses}패 · {summary.windowSize}경기

KDA{summary.kda}

{summary.avgKills} / {summary.avgDeaths} / {summary.avgAssists}

); } function RecentChampions({ summary, manifest }: { summary: PreviewSummary; manifest: DdragonManifest }) { return (

최근 사용 챔피언

{summary.windowSize}경기 기준
{summary.topChampions.slice(0, 5).map(champion => { const wins = Math.round(champion.games * champion.winRate / 100); return (
{championDisplayName(manifest, champion.championId)}

{champion.games}경기 · {wins}승 {champion.games - wins}패

{champion.winRate}%
); })} {summary.topChampions.length === 0 &&

최근 챔피언 기록이 없습니다.

}
); } function RecentGames({ matches, manifest }: { matches: PreviewMatch[]; manifest: DdragonManifest }) { return (

최근 내전

{Math.min(5, matches.length)}경기
{matches.slice(0, 5).map(match => { const name = championDisplayName(manifest, match.championId); const href = match.internalMatchId && match.gameNumber ? internalMatchGamePath(DEFAULT_COMMUNITY_ID, match.internalMatchId, match.gameNumber) : `/users/${USER_ID}/history?queueGroup=internal`; return (
{match.remake ? "다시하기" : match.win ? "승리" : "패배"} {name}

{formatDate(match.gameCreation).slice(5)}

{match.kills}/{match.deaths}/{match.assists}
); })}
); } function Masteries({ snapshot, manifest }: { snapshot: PreviewSnapshot; manifest: DdragonManifest }) { return (

누적 숙련도

경매 등록 기준
{(snapshot.masteries ?? []).slice(0, 5).map(champion => (
{championDisplayName(manifest, champion.championId)}

Lv.{champion.championLevel} · {(champion.championPoints / 1000).toFixed(0)}K

))}
); } function PlayerCard({ initialTab, label, profile, snapshot, manifest }: { initialTab: ProfileTab; label: string; profile: PreviewProfile; snapshot: PreviewSnapshot; manifest: DdragonManifest; }) { const [tab, setTab] = useState(initialTab); const summary = summaries[tab]; const preferences = [...snapshot.preferredPositions].sort((a, b) => a.priority - b.priority); const mainPosition = preferences[0]?.position ?? "MID"; const tier = profile.tier; const peakLabel = formatRankDetail(profile.peak); const historyHref = `/users/${USER_ID}/history?queueGroup=${tab === "internal" ? "internal" : "summoners-rift"}${tab === "solo" ? "&rank=solo" : ""}`; const tabPrefix = `profile-${initialTab}`; function handleTabKey(event: KeyboardEvent) { if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return; event.preventDefault(); const next = event.key === "Home" ? "internal" : event.key === "End" ? "solo" : tab === "internal" ? "solo" : "internal"; setTab(next); document.getElementById(`${tabPrefix}-${next}`)?.focus(); } return (
{initialTab === "internal" ? "01" : "02"} · {tab === "internal" ? "내전" : "솔로랭크"}

{profile.gameName}

#{profile.tagLine}
{formatRankDetail(tier)}현재
{peakLabel &&

기록된 최고 {peakLabel}

}
신청 포지션{preferences.slice(0, 2).map((preference, index) => {positionLabel[preference.position]}{index + 1}순위)}
{(["internal", "solo"] as const).map(value => )}

최근 {summary.windowSize}경기 · {tab === "internal" ? "내전" : "솔로랭크"}

전체 전적

전체 포지션 기준·마지막 경기 {formatDate(summary.lastGameAt)}

{tab === "internal" ? : }
{tab === "solo" && summary.lastFetchedAt && 전적 수집 기준 {formatDate(summary.lastFetchedAt)}}티어 확인 {formatDate(tier?.fetchedAt)}
{snapshot.passCount > 0 ? "유찰 — 강제 배정 대상" : "경매 참가 선수"}
); } export default function Preview() { return (

LOLYMPUS · 선수 정보 개선 시안

신청 포지션과 실제 경험을 한눈에

같은 선수의 두 탭을 나란히 볼 수 있습니다. 탭과 전적 링크를 직접 눌러보세요.

원래 경매 페이지

2026.11.11 확인 기록을 바탕으로 구성한 고정 시안 데이터입니다.

01 신청한 포지션과 실제 플레이 기록을 구분합니다.

02 최근 챔피언과 누적 숙련도를 따로 보여줍니다.

03 경기수와 기준일을 펼치기 없이 표시합니다.

); }