2026-08-25 21:26:18 +02:00
|
|
|
import type { Metadata } from "next";
|
2026-08-27 21:38:51 +02:00
|
|
|
import { ReplayPlayerLoader } from "@/components/sessions/ReplayPlayerLoader";
|
|
|
|
|
import { getSessionName } from "@/lib/db/queries/sessions";
|
2026-08-25 21:26:18 +02:00
|
|
|
|
|
|
|
|
export async function generateMetadata({ params }: { params: Promise<{ id: string }> }): Promise<Metadata> {
|
|
|
|
|
const { id } = await params;
|
2026-08-27 21:38:51 +02:00
|
|
|
const name = await getSessionName(Number(id));
|
2026-08-31 17:31:57 +02:00
|
|
|
return { title: name ? `${name} - Replay` : "Replay" };
|
2026-08-25 21:26:18 +02:00
|
|
|
}
|
2026-08-25 07:51:38 +02:00
|
|
|
|
|
|
|
|
export default async function ReplayPage({ params }: { params: Promise<{ id: string }> }) {
|
|
|
|
|
const { id } = await params;
|
2026-08-31 17:31:57 +02:00
|
|
|
const name = await getSessionName(Number(id));
|
2026-08-25 07:51:38 +02:00
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col gap-6">
|
2026-08-31 17:31:57 +02:00
|
|
|
<div>
|
|
|
|
|
<h1 className="font-heading text-2xl font-semibold">{name ?? `Session #${id}`} - Replay</h1>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
Connect the devices you want to replay onto, then match them to this session's original device
|
|
|
|
|
slots and play its recorded intensity back live over Web Bluetooth.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-08-27 21:38:51 +02:00
|
|
|
<ReplayPlayerLoader sessionId={Number(id)} />
|
2026-08-25 07:51:38 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|