import type { Metadata } from "next";
import { headers } from "next/headers";
import { auth } from "@/lib/auth/server";
import { FeatureTogglesForm } from "@/components/settings/feature-toggles-form";
import { getMessages } from "@/lib/i18n/server";

export const metadata: Metadata = {};

export default async function FeaturesSettingsPage() {
  const session = await auth.api.getSession({ headers: await headers() });
  const m = getMessages((session?.user as { locale?: string })?.locale);

  return (
    <section className="rounded-xl border p-6 space-y-4">
      <div>
        <h2 className="font-semibold text-lg">{m.settingsForm.featureToggles.title}</h2>
        <p className="text-sm text-muted-foreground mt-1">
          {m.settingsForm.featureToggles.description}
        </p>
      </div>
      <FeatureTogglesForm />
    </section>
  );
}
