35 lines
904 B
TypeScript
35 lines
904 B
TypeScript
import { db } from "@/db";
|
|
import { forms } from "@/db/schema";
|
|
import FormExtraClient from "./client";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function AdminExtraPage() {
|
|
let form = await db.query.forms.findFirst();
|
|
if (!form) {
|
|
const [newForm] = await db
|
|
.insert(forms)
|
|
.values({
|
|
title: "Erika Custom Form",
|
|
description: "Welcome! Please fill out the form below.",
|
|
})
|
|
.returning();
|
|
form = newForm;
|
|
}
|
|
|
|
return (
|
|
<div className="space-y-6 max-w-4xl mx-auto pb-12">
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<h1 className="text-3xl font-bold tracking-tight">Extra Settings</h1>
|
|
<p className="text-muted-foreground mt-1">
|
|
Configure Discord webhook integrations.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<FormExtraClient form={form} />
|
|
</div>
|
|
);
|
|
}
|