diff --git a/apps/web/src/components/TierHistoryChart.tsx b/apps/web/src/components/TierHistoryChart.tsx index 53ac5bdd..82cd329a 100644 --- a/apps/web/src/components/TierHistoryChart.tsx +++ b/apps/web/src/components/TierHistoryChart.tsx @@ -3,6 +3,7 @@ import { CartesianGrid, Line, LineChart, + ReferenceDot, ReferenceLine, ResponsiveContainer, Tooltip, @@ -52,6 +53,8 @@ const QUEUE_LABELS: Record = { }; type PeriodKey = "30" | "90" | "all"; +type SummaryVariant = "footer" | "inline"; +type SummaryDirection = "up" | "down" | "flat"; const PERIOD_OPTIONS: { key: PeriodKey; label: string; days: number | null }[] = [ @@ -112,6 +115,20 @@ function formatTierShort(tier: string) { return TIER_NAMES[tier] ?? tier; } +function formatPeriodChange(summary: { + first: ChartPoint; + last: ChartPoint; + direction: SummaryDirection; +}) { + const marker = + summary.direction === "up" + ? "▲" + : summary.direction === "down" + ? "▼" + : "·"; + return `${formatTierShort(summary.first.tier)} ${marker} ${formatTierShort(summary.last.tier)}`; +} + function formatDate(ms: number) { return new Intl.DateTimeFormat("ko-KR", { month: "numeric", @@ -160,9 +177,13 @@ function TierTooltip({ export default function TierHistoryChart({ entries, className = "border border-base-content/10 bg-base-100 mb-5 overflow-hidden", + summaryVariant = "footer", + height = 220, }: { entries: ApiTierHistoryEntry[]; className?: string; + summaryVariant?: SummaryVariant; + height?: number; }) { // 데이터에 존재하는 큐 목록 (솔로 우선) const availableQueues = useMemo(() => { @@ -220,7 +241,7 @@ export default function TierHistoryChart({ const peak = points.reduce((best, point) => point.value > best.value ? point : best, ); - const direction = + const direction: SummaryDirection = last.value > first.value ? "up" : last.value < first.value @@ -276,11 +297,29 @@ export default function TierHistoryChart({ ) : ( <> -
- +
+ {summaryVariant === "inline" && summary && ( +
+ 기간 {formatPeriodChange(summary)} +
+ )} + + {summaryVariant === "inline" && summary && ( + <> + + + + )}
- {summary && ( + {summary && summaryVariant === "footer" && (
현재{" "} @@ -366,13 +439,7 @@ export default function TierHistoryChart({ : "text-base-content/55" }`} > - {formatTierShort(summary.first.tier)} - {summary.direction === "up" - ? " ▲ " - : summary.direction === "down" - ? " ▼ " - : " · "} - {formatTierShort(summary.last.tier)} + {formatPeriodChange(summary)}
diff --git a/apps/web/src/pages/AuctionPage.tsx b/apps/web/src/pages/AuctionPage.tsx index 21eea02e..62b245a5 100644 --- a/apps/web/src/pages/AuctionPage.tsx +++ b/apps/web/src/pages/AuctionPage.tsx @@ -543,6 +543,21 @@ function PlayerSpotlight({
+ {tierHistory.length > 0 && ( + + } + > + + + )} +

@@ -589,19 +604,6 @@ function PlayerSpotlight({

- {tierHistory.length > 0 && ( - - } - > - - - )} - {(state.phase === 'bidding' || state.phase === 'sold') && (