31 lines
693 B
TypeScript
31 lines
693 B
TypeScript
import { db } from "@/db";
|
|
import { notFound } from "next/navigation";
|
|
import FormExtraClient from "./client";
|
|
import { RealtimeRefresh } from "@/components/realtime-refresh";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function AdminExtraPage(
|
|
props: {
|
|
params: Promise<{ id: string }>;
|
|
}
|
|
) {
|
|
const params = await props.params;
|
|
const form = await db.query.forms.findFirst({
|
|
where: (f, { eq }) => eq(f.id, params.id),
|
|
});
|
|
|
|
if (!form) {
|
|
return notFound();
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<RealtimeRefresh topic="forms" formId={form.id} />
|
|
<div className="w-full p-4 pb-12 md:p-6">
|
|
<FormExtraClient form={form} />
|
|
</div>
|
|
</>
|
|
);
|
|
}
|