Cards now sit on an animated signature-gradient background and use a translucent, blurred bp-glass surface so it shines through; extended bp-glass to every stat surface on the Stats page and to its tab switcher. Adds a Breadcrumbs component below the header on all app pages. Also: drop the gradient text fill from the wordmark/heading, animate the BrandMark's heart and curve on the dashboard hero instead of a plain pulse ring, recenter the heart/curve artwork in icon.svg and BrandMark, close the mobile nav menu on link click, remove the redundant "back to recordings" button, and match the "Start session"/"Scan for devices" button sizes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
48 lines
2.0 KiB
TypeScript
48 lines
2.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
import { SessionsSummaryCards } from "@/components/stats/SessionsSummaryCards";
|
|
import { DeviceUsageTable } from "@/components/stats/DeviceUsageTable";
|
|
import { RecordingLibraryStats } from "@/components/stats/RecordingLibraryStats";
|
|
import { getDeviceCommandCounts, getDeviceUsageStats, getRecordingLibraryStats, getSessionsSummary } from "@/lib/db/queries/stats";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
export const metadata: Metadata = { title: "Stats" };
|
|
|
|
export default async function StatsPage() {
|
|
const [sessionsSummary, deviceUsage, commandCounts, recordingStats] = await Promise.all([
|
|
getSessionsSummary(),
|
|
getDeviceUsageStats(),
|
|
getDeviceCommandCounts(),
|
|
getRecordingLibraryStats(),
|
|
]);
|
|
|
|
const commandCountByDevice = new Map(commandCounts.map((c) => [c.deviceId, c.commandCount]));
|
|
const devices = deviceUsage.map((d) => ({ ...d, commandCount: commandCountByDevice.get(d.deviceId) ?? 0 }));
|
|
|
|
return (
|
|
<div className="flex flex-col gap-6">
|
|
<div>
|
|
<h1 className="font-heading text-2xl font-semibold">Stats</h1>
|
|
<p className="text-sm text-muted-foreground">Usage across sessions, devices, and your recording library.</p>
|
|
</div>
|
|
|
|
<Tabs defaultValue="sessions">
|
|
<TabsList className="bp-glass">
|
|
<TabsTrigger value="sessions">Sessions</TabsTrigger>
|
|
<TabsTrigger value="devices">Devices</TabsTrigger>
|
|
<TabsTrigger value="recordings">Recordings</TabsTrigger>
|
|
</TabsList>
|
|
<TabsContent value="sessions" className="pt-4">
|
|
<SessionsSummaryCards summary={sessionsSummary} />
|
|
</TabsContent>
|
|
<TabsContent value="devices" className="pt-4">
|
|
<DeviceUsageTable devices={devices} />
|
|
</TabsContent>
|
|
<TabsContent value="recordings" className="pt-4">
|
|
<RecordingLibraryStats stats={recordingStats} />
|
|
</TabsContent>
|
|
</Tabs>
|
|
</div>
|
|
);
|
|
}
|