import { db } from "@/lib/db";
import { AdminPageHeader } from "@/components/admin/page-header";
import { SettingsForm } from "@/components/admin/settings-form";

export const dynamic = "force-dynamic";

export default async function AdminSettingsPage() {
  const settings = await db.siteSetting.upsert({
    where: { id: "singleton" },
    update: {},
    create: { id: "singleton" },
  });

  return (
    <>
      <AdminPageHeader
        title="Website Settings"
        description="Configure company info, contact details, social links and SEO defaults."
      />
      <SettingsForm initial={settings} />
    </>
  );
}
