import { requireWehrAdmin } from "@/lib/auth/guards";
import { listTemplates } from "@/server/data/vehicles";
import { getTemplateMerkmaleAction } from "@/server/actions/vehicles";
import { de } from "@/lib/i18n/de";
import { VehicleForm } from "@/components/verwaltung/VehicleForm";

export default async function FahrzeugNeuPage() {
  await requireWehrAdmin();
  const templates = await listTemplates();

  return (
    <div className="space-y-6">
      <h1 className="font-display text-2xl font-semibold text-navy">
        {de.verwaltung.fahrzeugAnlegen}
      </h1>
      <VehicleForm
        mode="create"
        templates={templates}
        loadTemplateMerkmale={getTemplateMerkmaleAction}
      />
    </div>
  );
}
