import Link from "next/link"; import AppNav from "@/components/AppNav"; import MixBench from "@/components/MixBench"; import { MEDIA_ROOTS } from "@/lib/paths"; import { isRefusal, resolvePreset } from "@/lib/mix-preset"; export const dynamic = "force-dynamic"; // A STATIC segment, so it wins over app/[mode]/page.tsx -- which would // otherwise catch /mix, fail isMode(), and 404. // // The deep link (?body=&start=&end=&from=&clip=) is resolved HERE, server-side. // That is what lets a clip reach the bench with no useSearchParams and no // Suspense boundary: this page already ran on the server, it just never read its // own searchParams. export default async function MixPage({ searchParams, }: { searchParams: Promise<{ body?: string; start?: string; end?: string; from?: string; clip?: string }>; }) { const sp = await searchParams; const resolved = await resolvePreset(sp); const refused = isRefusal(resolved) ? resolved : null; const preset = isRefusal(resolved) ? null : resolved; return (
{preset?.fromHref ? ( ← {preset.from} {preset.clip ? ` / ${preset.clip}` : ""} ) : (
set the handover and the end point, hear it, then render it
)}
{MEDIA_ROOTS.length} roots
{refused && ( // Refused, not clamped. A link that quietly opened a DIFFERENT file than // it named would be worse than this message.

that link was refused — {refused.reason}

)}
); }