2026-08-25 21:26:18 +02:00
|
|
|
import type { Metadata } from "next";
|
2026-08-25 07:51:38 +02:00
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
|
import { RecordingsTable } from "@/components/recordings/RecordingsTable";
|
2026-08-25 21:26:18 +02:00
|
|
|
import { PageNav } from "@/components/shared/PageNav";
|
|
|
|
|
import { listRecordingsPage } from "@/lib/db/queries/recordings";
|
|
|
|
|
import { parsePage } from "@/lib/pagination";
|
2026-08-25 07:51:38 +02:00
|
|
|
|
|
|
|
|
export const dynamic = "force-dynamic";
|
2026-08-25 21:26:18 +02:00
|
|
|
export const metadata: Metadata = { title: "Recordings" };
|
2026-08-25 07:51:38 +02:00
|
|
|
|
2026-08-25 21:26:18 +02:00
|
|
|
export default async function RecordingsPage({
|
|
|
|
|
searchParams,
|
|
|
|
|
}: {
|
|
|
|
|
searchParams: Promise<{ page?: string }>;
|
|
|
|
|
}) {
|
|
|
|
|
const page = parsePage((await searchParams).page);
|
|
|
|
|
const { items: recordings, pageSize, total } = await listRecordingsPage(page);
|
2026-08-25 07:51:38 +02:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col gap-6">
|
|
|
|
|
<div>
|
2026-08-25 16:43:28 +02:00
|
|
|
<h1 className="font-heading text-2xl font-semibold">Recordings</h1>
|
2026-08-25 07:51:38 +02:00
|
|
|
<p className="text-sm text-muted-foreground">Saved sessions you can replay against connected devices.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Card className="bp-glass">
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-base">Library</CardTitle>
|
|
|
|
|
</CardHeader>
|
2026-08-25 21:26:18 +02:00
|
|
|
<CardContent className="flex flex-col gap-3">
|
2026-08-25 07:51:38 +02:00
|
|
|
<RecordingsTable recordings={recordings} />
|
2026-08-25 21:26:18 +02:00
|
|
|
<PageNav basePath="/recordings" page={page} pageSize={pageSize} total={total} />
|
2026-08-25 07:51:38 +02:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|