Loading component…
Loading component…
This component has not been implemented locally yet.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/ModelUsage from ./agent-analytics.
import { AgentAnalyticsScreen } from "@/components/ui/agent-analytics";
export default function Page() {
return (
<AgentAnalyticsScreen
project="Support Copilot"
models={(range) => usage[range]} // [{ id, name, maker, logo?, color, runs, tokens, cost, success, change: { runs, tokens }, lastUsed, daily }]
onExport={(range) => download(range)}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| project | string | "Support Copilot" | The project in the head – a click opens the switch to projects |
| projects | { name; sub? }[] | The projects in the switch, with a line under each | |
| models | AanModel[] \| (range) => AanModel[] | The models over the period – name, maker and logo, a color for its line, runs, tokens, cost, success (0–1), the change since the period before, when it last ran and its tokens per day. Left out, a sample that scales with the period | |
| today | Date | The last day of the period – the chart counts back from it | |
| onTab | (tab) => void | Called when another tab is picked | |
| onExport | (range) => void | Export | |
| loading | boolean | Gray numbers, chart and rows | |
| empty | boolean | No runs yet – dashes in the strip and a note in place of the chart | |
| workspace | string | "Northwind" | The workspace in the sidebar |
| onNavigate | (label: string) => void | Called with the label of a sidebar item | |
| className | string | Extra class on the root |
The strip of numbers goes two by two on narrower screens, the table drops success and last used
On phones the table keeps the model, runs and tokens; the chart keeps its full width
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"