From 7ec7162147f0e1d6e349e392f5056b0a6f2cb40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EB=8B=A4=ED=98=84=20=28Dahyeon=20Park=29?= Date: Wed, 22 Apr 2026 11:00:00 +0900 Subject: [PATCH] feat(web): build home and player history pages --- apps/web/src/App.css | 1 + apps/web/src/App.tsx | 106 +++ apps/web/src/pages/HomePage.tsx | 239 ++++++ apps/web/src/pages/UserHistoryPage.tsx | 1019 ++++++++++++++++++++++++ 4 files changed, 1365 insertions(+) create mode 100644 apps/web/src/App.css create mode 100644 apps/web/src/App.tsx create mode 100644 apps/web/src/pages/HomePage.tsx create mode 100644 apps/web/src/pages/UserHistoryPage.tsx diff --git a/apps/web/src/App.css b/apps/web/src/App.css new file mode 100644 index 00000000..e00a71c3 --- /dev/null +++ b/apps/web/src/App.css @@ -0,0 +1 @@ +/* App-specific styles — currently using Tailwind + daisyUI */ diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx new file mode 100644 index 00000000..2cfd3c0e --- /dev/null +++ b/apps/web/src/App.tsx @@ -0,0 +1,106 @@ +import { BrowserRouter, Link, Route, Routes } from 'react-router'; +import { useMsal } from '@azure/msal-react'; +import DevAuthSwitcher from './components/DevAuthSwitcher'; +import { DEFAULT_COMMUNITY_ID } from './config'; +import { useCommunity } from './api/hooks'; +import { isMsalConfigured } from './lib/auth/msal.config'; +import AuthCallbackPage from './pages/AuthCallback'; +import HomePage from './pages/HomePage'; +import LoginPage from './pages/Login'; +import MatchDetailPage from './pages/MatchDetailPage'; +import AuctionPage from './pages/AuctionPage'; +import UserHistoryPage from './pages/UserHistoryPage'; +import CommunityInternalStatsPage from './pages/CommunityInternalStatsPage'; +import InternalMatchDetailPage from './pages/InternalMatchDetailPage'; +import LegacyImportPage from './pages/admin/LegacyImportPage'; +import LegacyMatchesPage from './pages/admin/LegacyMatchesPage'; +import TournamentCodesPage from './pages/admin/TournamentCodesPage'; + +function MsalHeaderActions() { + const { accounts, instance } = useMsal(); + const account = instance.getActiveAccount() ?? accounts[0]; + + if (!account) { + return ( + + 로그인 + + ); + } + + return ( + + ); +} + +function App() { + const communityQuery = useCommunity(DEFAULT_COMMUNITY_ID); + const communityLabel = communityQuery.data?.name ?? 'LOLYMPUS'; + + return ( + +
+ + + + } /> + } /> + } /> + } /> + } /> + } /> + } + /> + } + /> + } + /> + } + /> + } + /> + + +
+
+ ); +} + +export default App; diff --git a/apps/web/src/pages/HomePage.tsx b/apps/web/src/pages/HomePage.tsx new file mode 100644 index 00000000..5b2737b5 --- /dev/null +++ b/apps/web/src/pages/HomePage.tsx @@ -0,0 +1,239 @@ +import { Link } from 'react-router'; +import { mapApiMatchToMatchDetail } from '../api/mappers'; +import { useMatches } from '../api/hooks'; +import { DEFAULT_COMMUNITY_ID } from '../config'; + +function StatusBadge({ status }: { status: string }) { + const styles: Record = { + 모집중: 'bg-green-500/15 text-green-500 border-green-500/20', + 팀빌딩: 'bg-amber-500/15 text-amber-500 border-amber-500/20', + 진행중: 'bg-blue-500/15 text-blue-400 border-blue-500/20', + 종료: 'bg-base-content/8 text-base-content/40 border-base-content/10', + }; + + return ( + + {status} + + ); +} + +function MapBadge({ map }: { map: string }) { + return ( + + {map} + + ); +} + +function getStatusLabel(status: string) { + switch (status) { + case 'recruiting': + return '모집중'; + case 'team-built': + return '팀빌딩'; + case 'in-progress': + return '진행중'; + case 'finished': + return '종료'; + default: + return status; + } +} + +export default function HomePage() { + const upcomingMatchesQuery = useMatches({ limit: 20 }, DEFAULT_COMMUNITY_ID); + const finishedMatchesQuery = useMatches( + { status: 'finished', limit: 10 }, + DEFAULT_COMMUNITY_ID, + ); + + if (!DEFAULT_COMMUNITY_ID) { + return ( +
+
+ `apps/web/.env.development`의 `VITE_DEFAULT_COMMUNITY_ID`를 먼저 설정해주세요. +
+
+ ); + } + + if (upcomingMatchesQuery.isLoading || finishedMatchesQuery.isLoading) { + return ( +
+ 매치 목록을 불러오는 중... +
+ ); + } + + if (upcomingMatchesQuery.error || finishedMatchesQuery.error) { + return ( +
+ + 매치 목록을 불러오지 못했습니다. + +
+ ); + } + + const upcomingMatches = + upcomingMatchesQuery.data?.map(mapApiMatchToMatchDetail) ?? []; + const finishedMatches = + finishedMatchesQuery.data?.map(mapApiMatchToMatchDetail) ?? []; + const nextMatch = upcomingMatches[0]; + const upcomingCards = nextMatch ? upcomingMatches.slice(1) : upcomingMatches; + + return ( +
+
+
+

+ 다음 내전 +

+ + 내전 전적 보기 + +
+ + {nextMatch ? ( + +
+
+
+
+
+

+ {nextMatch.title} +

+ +
+

+ {nextMatch.description} +

+
+ {nextMatch.date} {nextMatch.time} + | + + {nextMatch.participants.length}/{nextMatch.maxParticipants}명 + + | + +
+
+
+ + 상세 보기 + +
+
+
+
+ + ) : ( +
+ 아직 등록된 내전이 없습니다. +
+ )} +
+ +
+

+ 예정된 내전 +

+
+ {upcomingCards.length > 0 ? ( + upcomingCards.map((match) => ( + +
+
+

+ {match.title} +

+ +
+
+
{match.date} {match.time}
+
+ {match.participants.length}/{match.maxParticipants}명 +
+
+
+ +
+
+ + )) + ) : ( +
+ 예정된 추가 매치가 없습니다. +
+ )} +
+
+ +
+

+ 지난 내전 기록 +

+
+ + + + + + + + + + + + {finishedMatches.length > 0 ? ( + finishedMatches.map((match) => ( + + + + + + + + )) + ) : ( + + + + )} + +
날짜내전맵참가결과
+ {match.date} + + + {match.title} + + + + + {match.participants.length}명 + + {match.result?.winner ? `${match.result.winner} 승리` : '-'} +
+ 아직 종료된 내전 기록이 없습니다. +
+
+
+
+ ); +} diff --git a/apps/web/src/pages/UserHistoryPage.tsx b/apps/web/src/pages/UserHistoryPage.tsx new file mode 100644 index 00000000..28dcf98a --- /dev/null +++ b/apps/web/src/pages/UserHistoryPage.tsx @@ -0,0 +1,1019 @@ +import { useMemo, useState } from "react"; +import { useQueryClient } from "@tanstack/react-query"; +import { Link, useParams, useSearchParams } from "react-router"; +import { + useChampionStats, + useDdragonManifest, + useRecentMatches, + useRecentSummary, + useRefreshUserHistory, + useUserInternalHistory, + useUserHistoryProfile, + type UserHistoryFilters, +} from "../api/hooks"; +import { useRiotRefreshSocket } from "../api/useRiotRefreshSocket"; +import { formatTierLabel, getTierColorToken } from "../api/mappers"; +import type { + ApiChampionStatsRow, + ApiEnqueueRefreshResult, + ApiRiotRefreshEvent, + ApiRecentMatchView, + DdragonManifest, + RiotQueueGroup, + RiotRankFilter, +} from "../api/types"; +import { DEFAULT_COMMUNITY_ID } from "../config"; +import { ApiError } from "../lib/api"; +import { + championDisplayName, + championIconUrl, + itemIconUrl, + profileIconUrl, +} from "../lib/ddragon"; +import { + isRiotQueueGroup, + isRiotRankFilter, + LANE_LABELS, + QUEUE_GROUP_TABS, + RANK_FILTER_TABS, +} from "../lib/riot-history"; + +type ChampionSortKey = "games" | "winRate" | "kda" | "avgCsPerMin"; + +const SORT_LABELS: Record = { + games: "게임 수", + winRate: "승률", + kda: "KDA", + avgCsPerMin: "분당 CS", +}; + +function formatDuration(seconds: number) { + const minutes = Math.floor(seconds / 60); + const rest = seconds % 60; + return `${minutes}:${String(rest).padStart(2, "0")}`; +} + +function formatDate(ms: number) { + return new Intl.DateTimeFormat("ko-KR", { + month: "long", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + }).format(new Date(ms)); +} + +function formatLastFetched(value: string | null | undefined) { + if (!value) return "저장된 갱신 시각 없음"; + return new Intl.DateTimeFormat("ko-KR", { + month: "long", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + }).format(new Date(value)); +} + +function formatEta(seconds: number) { + if (seconds < 60) return `${Math.max(1, Math.ceil(seconds))}초`; + return `${Math.ceil(seconds / 60)}분`; +} + +function formatRefreshError(error: unknown) { + if (error instanceof ApiError) { + const data = error.data; + if ( + typeof data === "object" && + data !== null && + "retryAfterSeconds" in data && + typeof data.retryAfterSeconds === "number" + ) { + return `잠시 후 다시 시도해 주세요. 약 ${formatEta(data.retryAfterSeconds)} 뒤에 요청할 수 있습니다.`; + } + return error.message; + } + return error instanceof Error ? error.message : "갱신 요청에 실패했습니다."; +} + +function ratioClass(value: number) { + if (value >= 55) return "text-blue-400"; + if (value >= 50) return "text-amber-400"; + return "text-base-content/50"; +} + +function kdaClass(value: number) { + if (value >= 4) return "text-amber-400"; + if (value >= 3) return "text-emerald-400"; + return "text-base-content/60"; +} + +function FilterButton({ + active, + children, + onClick, +}: { + active: boolean; + children: React.ReactNode; + onClick: () => void; +}) { + return ( + + ); +} + +function ChampionIcon({ + championId, + manifest, + size = "md", +}: { + championId: number; + manifest: DdragonManifest | null | undefined; + size?: "sm" | "md" | "lg"; +}) { + const iconUrl = championIconUrl(manifest, championId); + const displayName = + championDisplayName(manifest, championId) ?? String(championId); + const sizeClass = + size === "lg" ? "w-12 h-12" : size === "sm" ? "w-5 h-5" : "w-8 h-8"; + + return ( +
+ {iconUrl ? ( + {displayName} + ) : null} +
+ ); +} + +function SummaryCard({ + label, + value, + sub, +}: { + label: string; + value: React.ReactNode; + sub?: React.ReactNode; +}) { + return ( +
+
+ {label} +
+
+ {value} +
+ {sub && ( +
{sub}
+ )} +
+ ); +} + +function ChampionStatsTable({ + rows, + manifest, + selectedChampionId, + onChampionSelect, +}: { + rows: ApiChampionStatsRow[]; + manifest: DdragonManifest | null | undefined; + selectedChampionId?: number; + onChampionSelect: (championId: number | null) => void; +}) { + if (rows.length === 0) { + return ( +
+ 조건에 맞는 챔피언 통계가 아직 없습니다. +
+ ); + } + + return ( +
+
+ + + + + + + + + + + + + + + + + + {rows.map((row) => { + const displayName = + championDisplayName(manifest, row.championId) ?? + String(row.championId); + const selected = selectedChampionId === row.championId; + return ( + + + + + + + + + + + + + + ); + })} + +
챔피언승률게임승/패KDA킬데스어시스트멀티킬CS필터
+
+ + + {displayName} + +
+
+ {row.winRate}% + + {row.games} + + {row.wins} /{" "} + {row.losses} + + {row.kda} + + {row.totalKills} + + {row.totalDeaths} + + {row.totalAssists} + + {row.doubleKills}/{row.tripleKills}/{row.quadraKills}/ + {row.pentaKills} + + {row.avgCs} · {row.avgCsPerMin}/m + + +
+
+
+ ); +} + +function ItemGrid({ + match, + manifest, +}: { + match: ApiRecentMatchView; + manifest: DdragonManifest | null | undefined; +}) { + const slots = [...match.items, match.trinket]; + return ( +
+ {slots.map((itemId, index) => { + const url = itemIconUrl(manifest, itemId); + return ( +
+ {url ? ( + + ) : null} +
+ ); + })} +
+ ); +} + +function TeamMini({ + match, + manifest, +}: { + match: ApiRecentMatchView; + manifest: DdragonManifest | null | undefined; +}) { + return ( +
+ {match.teams.map((team) => ( +
+ {team.participants.map((participant) => { + const championName = + championDisplayName(manifest, participant.championId) ?? + String(participant.championId); + return ( +
+ + + {participant.gameName || championName} + +
+ ); + })} +
+ ))} +
+ ); +} + +function RecentMatchCard({ + match, + manifest, +}: { + match: ApiRecentMatchView; + manifest: DdragonManifest | null | undefined; +}) { + const championName = + championDisplayName(manifest, match.championId) ?? String(match.championId); + const accent = match.win ? "border-l-blue-500" : "border-l-red-500"; + const resultClass = match.win ? "text-blue-400" : "text-red-400"; + + return ( +
+
+
+
+ {match.remake ? "다시하기" : match.win ? "승리" : "패배"} +
+
+ {match.queueLabel} +
+
+ {formatDate(match.gameCreation)} +
+
+ {formatDuration(match.gameDuration)} +
+
+ +
+ +
+
+ {championName} +
+
+ Lv.{match.championLevel} ·{" "} + {(LANE_LABELS[match.teamPosition] ?? match.teamPosition) || + "포지션 없음"} +
+
+ 스펠 {match.summonerSpells.join(" / ")} +
+
+
+ +
+
+ {match.kills} + / + {match.deaths} + / + {match.assists} +
+
+ {match.deaths === 0 ? "Perfect" : `${match.kda} 평점`} +
+
+ 킬 관여 {match.killParticipation}% +
+
+ +
+
+
+ CS{" "} + + {match.totalCs} + {" "} + ({match.csPerMin}/m) +
+
+ 시야{" "} + + {match.visionScore} + {" "} + 제어와드 {match.controlWardsBought} +
+
+ 피해량{" "} + + {match.damageDealtToChampions.toLocaleString()} + +
+
+
+ + +
+
+ +
+
+
+
+
+ ); +} + +export default function UserHistoryPage() { + const { userId } = useParams(); + const queryClient = useQueryClient(); + const [searchParams, setSearchParams] = useSearchParams(); + const [championSearch, setChampionSearch] = useState(""); + const [sortKey, setSortKey] = useState("games"); + const [refreshResult, setRefreshResult] = + useState(null); + const [refreshNotice, setRefreshNotice] = useState(null); + const queueGroupParam = searchParams.get("queueGroup"); + const rankParam = searchParams.get("rank"); + const queueGroup: RiotQueueGroup = isRiotQueueGroup(queueGroupParam) + ? queueGroupParam + : "summoners-rift"; + const isInternalQueue = queueGroup === "internal"; + const rank: RiotRankFilter = + !isInternalQueue && isRiotRankFilter(rankParam) ? rankParam : "all"; + const championIdParam = Number(searchParams.get("championId")); + const championId = + Number.isFinite(championIdParam) && championIdParam > 0 + ? championIdParam + : undefined; + const filters: UserHistoryFilters = { + queueGroup, + rank, + championId, + seasonId: searchParams.get("seasonId") ?? undefined, + }; + const aggregateFilters: UserHistoryFilters = { + queueGroup, + rank, + seasonId: filters.seasonId, + }; + const { data: ddragon } = useDdragonManifest(); + const profileQuery = useUserHistoryProfile(userId, DEFAULT_COMMUNITY_ID); + const standardHistoryEnabled = !isInternalQueue; + const championStatsQuery = useChampionStats( + userId, + aggregateFilters, + DEFAULT_COMMUNITY_ID, + standardHistoryEnabled, + ); + const summaryQuery = useRecentSummary( + userId, + filters, + DEFAULT_COMMUNITY_ID, + standardHistoryEnabled, + ); + const recentMatchesQuery = useRecentMatches( + userId, + filters, + DEFAULT_COMMUNITY_ID, + standardHistoryEnabled, + ); + const internalHistoryQuery = useUserInternalHistory( + userId, + filters, + DEFAULT_COMMUNITY_ID, + isInternalQueue, + ); + const refreshMutation = useRefreshUserHistory(userId, DEFAULT_COMMUNITY_ID); + + const profile = profileQuery.data; + const primaryTier = + profile?.tiers.find((tier) => tier.queueType === "RANKED_SOLO_5x5") ?? + profile?.tiers[0]; + const internalPages = internalHistoryQuery.data?.pages ?? []; + const internalFirstPage = internalPages[0]; + const summary = isInternalQueue + ? internalFirstPage?.summary + : summaryQuery.data; + const matches = isInternalQueue + ? internalPages.flatMap((page) => page.matches) + : (recentMatchesQuery.data?.pages.flatMap((page) => page.matches) ?? []); + const historyLastFetchedAt = isInternalQueue + ? internalFirstPage?.lastFetchedAt + : recentMatchesQuery.data?.pages[0]?.lastFetchedAt; + const matchesLoading = isInternalQueue + ? internalHistoryQuery.isLoading + : recentMatchesQuery.isLoading; + const hasNextPage = isInternalQueue + ? internalHistoryQuery.hasNextPage + : recentMatchesQuery.hasNextPage; + const isFetchingNextPage = isInternalQueue + ? internalHistoryQuery.isFetchingNextPage + : recentMatchesQuery.isFetchingNextPage; + const selectedChampionName = championId + ? (championDisplayName(ddragon, championId) ?? String(championId)) + : null; + + const visibleChampionRows = useMemo(() => { + const rows = isInternalQueue + ? (internalFirstPage?.championStats.champions ?? []) + : (championStatsQuery.data?.champions ?? []); + const keyword = championSearch.trim().toLowerCase(); + return rows + .filter((row) => { + if (!keyword) return true; + const displayName = + championDisplayName(ddragon, row.championId) ?? + String(row.championId); + return displayName.toLowerCase().includes(keyword); + }) + .sort((left, right) => right[sortKey] - left[sortKey]); + }, [ + championSearch, + championStatsQuery.data?.champions, + ddragon, + internalFirstPage?.championStats.champions, + isInternalQueue, + sortKey, + ]); + + const refreshSocket = useRiotRefreshSocket({ + puuid: isInternalQueue ? undefined : profile?.puuid, + parentJobId: refreshResult?.parentJobId, + onEvent: (event: ApiRiotRefreshEvent) => { + if (!profile || event.puuid !== profile.puuid) return; + void invalidateHistoryQueries(); + if (event.state === "completed") { + setRefreshNotice("갱신이 완료되어 전적을 다시 불러왔습니다."); + } + if (event.state === "failed") { + setRefreshNotice( + event.error + ? `갱신 실패: ${event.error}` + : "갱신에 실패했습니다. 잠시 후 다시 시도해 주세요.", + ); + } + }, + }); + + function updateSearch(next: Partial>) { + const params = new URLSearchParams(searchParams); + for (const [key, value] of Object.entries(next)) { + if (value === null || value === undefined || value === "") { + params.delete(key); + } else { + params.set(key, String(value)); + } + } + setSearchParams(params); + } + + async function invalidateHistoryQueries() { + await Promise.all([ + queryClient.invalidateQueries({ + queryKey: [ + "user-history-profile", + DEFAULT_COMMUNITY_ID, + userId ?? null, + ], + }), + queryClient.invalidateQueries({ + queryKey: ["user-champion-stats", DEFAULT_COMMUNITY_ID, userId ?? null], + }), + queryClient.invalidateQueries({ + queryKey: ["user-recent-summary", DEFAULT_COMMUNITY_ID, userId ?? null], + }), + queryClient.invalidateQueries({ + queryKey: ["user-recent-matches", DEFAULT_COMMUNITY_ID, userId ?? null], + }), + queryClient.invalidateQueries({ + queryKey: [ + "user-internal-history", + DEFAULT_COMMUNITY_ID, + userId ?? null, + ], + }), + ]); + } + + function handleRefresh() { + if (!userId) return; + if (isInternalQueue) { + setRefreshResult(null); + setRefreshNotice("과거의 토너먼트 결과 수집 데이터를 다시 조회합니다."); + void queryClient.invalidateQueries({ + queryKey: [ + "user-internal-history", + DEFAULT_COMMUNITY_ID, + userId ?? null, + ], + }); + return; + } + refreshMutation.mutate( + { queueGroups: [queueGroup], priority: "high" }, + { + onSuccess: (result) => { + setRefreshResult(result); + const alreadyQueued = result.subJobs.every( + (job) => job.alreadyQueued, + ); + setRefreshNotice( + alreadyQueued + ? `이미 갱신 작업이 대기 중입니다. 예상 ${formatEta(result.totalEtaSeconds)} 후 반영됩니다.` + : `갱신을 요청했습니다. 예상 ${formatEta(result.totalEtaSeconds)} 후 반영됩니다.`, + ); + }, + onError: (error) => { + setRefreshNotice(formatRefreshError(error)); + }, + }, + ); + } + + if (!DEFAULT_COMMUNITY_ID) { + return ( +
+ + `VITE_DEFAULT_COMMUNITY_ID` 설정이 필요합니다. + +
+ ); + } + + if (profileQuery.isLoading) { + return ( +
+ + 소환사 전적을 불러오는 중... + +
+ ); + } + + if (profileQuery.error || !profile) { + return ( +
+

소환사를 찾을 수 없습니다

+ + 홈으로 돌아가기 + +
+ ); + } + + return ( +
+ + ← 목록으로 + + +
+
+
+ +
+
+
+

+ {profile.gameName} +

+ + #{profile.tagLine} + +
+
+ Lv.{profile.summonerLevel} + {primaryTier ? ( + + {formatTierLabel(primaryTier)} {primaryTier.leaguePoints}LP + + ) : ( + 랭크 정보 없음 + )} + 시즌: {profile.season.label} + 최근 저장: {formatLastFetched(profile.lastFetchedAt)} +
+
+
+
+ {isInternalQueue ? ( + <> + {/* 내전 탭은 토너먼트 결과 DB를 조회합니다. */} + {/* Riot API 갱신 없이 수집된 내전 결과를 다시 불러옵니다. */} + 내전 기록이 확인되지 않을 경우 버튼을 눌러 갱신 (테스트) + + ) : ( + <> + {/* 이 페이지는 저장된 경기 DB만 조회합니다. */} +
+ {/* Riot API 갱신은 버튼 클릭 시 큐에서 처리합니다. */} + 아래 버튼을 누르면 기록이 갱신됩니다. + + )} +
+ + {!isInternalQueue && ( +
+ 갱신 소켓: {refreshSocket.connectionStatus} +
+ )} +
+
+ {(refreshNotice || refreshSocket.error) && ( +
+ {refreshNotice ?? refreshSocket.error} +
+ )} +
+ +
+
+ {QUEUE_GROUP_TABS.map((tab) => ( + + updateSearch({ queueGroup: tab.value, championId: null }) + } + > + {tab.label} + + ))} +
+
+ {!isInternalQueue ? ( +
+ {RANK_FILTER_TABS.map((tab) => ( + + updateSearch({ rank: tab.value, championId: null }) + } + > + {tab.label} + + ))} +
+ ) : ( +
+ 내전 탭은 토너먼트 코드 결과 수집 데이터를 기준으로 집계합니다. +
+ )} + {selectedChampionName && ( + + )} + {profile.seasons.length > 0 && ( + + )} +
+
+ +
+

+ 최근 {summary?.windowSize ?? 20}게임 전적 요약 +

+
+ + + + +
+
+ 자주 플레이한 챔피언 +
+
+ {(summary?.topChampions ?? []).map((champion) => ( + + ))} + {(summary?.topChampions ?? []).length === 0 && ( + + 기록 없음 + + )} +
+
+
+
+ +
+
+
+

챔피언 통계

+

+ 저장된 데이터를 기준으로 집계합니다. 최신 데이터가 반영되지 않을 + 수 있습니다. +

+
+
+ setChampionSearch(event.target.value)} + placeholder="챔피언 검색" + className="border border-base-content/10 bg-transparent px-3 py-2 text-xs focus:outline-none focus:border-primary/30" + /> + +
+
+ + updateSearch({ championId: nextChampionId }) + } + /> +
+ +
+
+

매치 히스토리

+ + 최근 저장: {formatLastFetched(historyLastFetchedAt)} + +
+ + {matchesLoading ? ( +
+ 최근 경기를 불러오는 중... +
+ ) : matches.length === 0 ? ( +
+ 조건에 맞는 최근 경기 기록이 없습니다. +
+ ) : ( +
+ {matches.map((match) => ( + + ))} +
+ )} + + {hasNextPage && ( + + )} +
+
+ ); +}