import '@/app/styles/community.scss'; import '@/app/styles/data-table.scss'; import { Metadata } from 'next'; import Link from 'next/link'; import { fetchTrackRecordLeaderboard } from '@/lib/api/community'; import TierBadge from '@/components/community/TierBadge'; export const metadata: Metadata = { title: '예측 적중률 리더보드 — 개미투자', description: '종목 예측글 채점 기반 적중률 순위 (표본 10건 이상 · 전체 기간)' }; const PAGE_SIZE = 50; type Props = { searchParams: Promise<{ page?: string; }>; }; export default async function TrackRecordLeaderboardPage({ searchParams }: Props) { const query = await searchParams; const page = Math.max(Number(query.page) || 1, 1); const res = await fetchTrackRecordLeaderboard({ page }); const data = res.success ? res.data : null; const rows = data?.list ?? []; const totalPages = data ? Math.max(Math.ceil(data.total / PAGE_SIZE), 1) : 1; return (
| 순위 | 닉네임 | 적중률 | 최고 스트릭 | 표본수 | 티어 |
|---|---|---|---|---|---|
| {row.rank} | {row.name} | {row.hitRate.toFixed(1)}% | {row.bestStreak.toLocaleString()} | {row.predictions.toLocaleString()} |