From 408ea8a219a5b5f0122e428206bc222ee531b3e7 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Sun, 11 Oct 2026 20:35:00 +0700 Subject: [PATCH] feat : update analis page --- .../public/analytics-dashboard.test.tsx | 4 ++-- components/public/analytics-dashboard.tsx | 7 +++++- lib/analytics/model.test.ts | 6 ++--- lib/analytics/model.ts | 1 + lib/analytics/queries.ts | 24 ++++++++++++++----- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/components/public/analytics-dashboard.test.tsx b/components/public/analytics-dashboard.test.tsx index 7ba0c65..a90a982 100644 --- a/components/public/analytics-dashboard.test.tsx +++ b/components/public/analytics-dashboard.test.tsx @@ -19,8 +19,8 @@ const item = (key: string, guideCount: number, stygianCount: number): AnalyticsI const entries = [item("Shared", 2, 5), item("Stygian only", 0, 3)]; const data: PublicAnalytics = { guides: [ - ...Array.from({ length: 4 }, (_, index) => ({ id: `g${index}`, source: "guide" as const, name: `Guide ${index}` })), - ...Array.from({ length: 2 }, (_, index) => ({ id: `s${index}`, source: "stygian" as const, name: `Stygian ${index}` })), + ...Array.from({ length: 4 }, (_, index) => ({ id: `g${index}`, source: "guide" as const, name: `Guide ${index}`, character: null })), + ...Array.from({ length: 2 }, (_, index) => ({ id: `s${index}`, source: "stygian" as const, name: `Stygian ${index}`, character: null })), ], teamGroups: [{ guideId: "g0", signature: "guide-team", count: 1 }, { guideId: "s0", signature: "stygian-team", count: 1 }], guideCount: 4, stygianScheduleCount: 2, guideTeamCount: 6, stygianTeamCount: 3, diff --git a/components/public/analytics-dashboard.tsx b/components/public/analytics-dashboard.tsx index d3b56c4..a933ad8 100644 --- a/components/public/analytics-dashboard.tsx +++ b/components/public/analytics-dashboard.tsx @@ -5,6 +5,7 @@ import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from "recharts" import { CheckIcon, MinusIcon } from "lucide-react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; +import { CatalogItemImage } from "@/components/catalog-item-image"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"; @@ -95,7 +96,7 @@ function UsageRanking({ title, description, items, characterItems = false }: { {item.name.slice(0, 1)} - + {item.name} {rarityLabel(item.rarity)} @@ -168,6 +169,10 @@ export function AnalyticsDashboard({ data }: { data: PublicAnalytics }) { className="h-auto min-h-11 max-w-full whitespace-normal text-left" aria-label={`นับไกด์ ${guide.name}`} aria-pressed={included} disabled={source === "stygian" && !includeStygian} onClick={() => toggleGuide(guide.id)}> + {guide.character?.imageUrl ? : null} {included ?