import { definePage } from "@squadbase/vantage" import { DashboardCardPreset, EChart, PageShell, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeading, PageShellTitle, Placeholder, Sparkline, type EChartsOption, } from "@squadbase/vantage/components" export const page = definePage({ title: "Dashboard", description: "Sample data — replace with your own to get started.", navLabel: "Home", placeholder: true, }) const METRICS = [ { label: "Metric 1", value: "1,234", trend: [3, 4, 3, 5, 6, 5, 7] }, { label: "Metric 2", value: "5,678", trend: [6, 5, 6, 4, 5, 6, 6] }, { label: "Metric 3", value: "90.1%", trend: [2, 3, 5, 4, 6, 7, 8] }, { label: "Metric 4", value: "$12.3k", trend: [5, 6, 4, 6, 5, 7, 6] }, ] // Sample charts. `EChart` paints series with `--chart-1..5` and the sparklines // use `--primary` (both from `styles.css`), so a theme change shows up here. const BAR_OPTION: EChartsOption = { legend: { top: 0 }, grid: { top: 36, right: 8, bottom: 24, left: 36 }, xAxis: { type: "category", data: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] }, yAxis: { type: "value" }, series: [ { name: "Series A", type: "bar", data: [12, 18, 15, 22, 26, 24] }, { name: "Series B", type: "bar", data: [8, 11, 13, 12, 16, 19] }, { name: "Series C", type: "bar", data: [5, 7, 6, 9, 8, 11] }, ], } const PIE_OPTION: EChartsOption = { legend: { bottom: 0 }, series: [ { type: "pie", radius: ["45%", "70%"], center: ["50%", "45%"], label: { show: false }, data: [ { name: "Category A", value: 35 }, { name: "Category B", value: 25 }, { name: "Category C", value: 18 }, { name: "Category D", value: 12 }, { name: "Category E", value: 10 }, ], }, ], } const CHARTS = [ { title: "Chart 1", option: BAR_OPTION }, { title: "Chart 2", option: PIE_OPTION }, ] export default function HomePage() { // `data-vantage-sample` marks this page as the untouched template sample (the coding // agent looks for it). Remove it together with the sample content. const sampleNote = document.documentElement.lang.startsWith("ja") ? "サンプルデータです。お手元のデータに置き換えて始めましょう。" : "Sample data — replace with your own to get started." return ( Dashboard {sampleNote}
{METRICS.map((metric) => ( {metric.value} ({ value }))} color="text-primary" area /> ))}
{CHARTS.map((chart) => ( ))}
) }