import { verifySession } from "@/lib/dal";
import { getCategories } from "@/lib/data/categories";
import { NeedForm } from "@/components/needs/need-form";

export default async function NewNeedPage() {
  await verifySession();
  const categories = await getCategories();

  return (
    <div className="mx-auto max-w-2xl px-4 py-8 sm:px-6 sm:py-10">
      <h1 className="text-2xl font-semibold">Publier un besoin</h1>
      <p className="mt-1 text-muted-foreground">
        Décris ce que tu cherches, les commerçants pourront te faire des
        offres.
      </p>
      <div className="mt-8">
        <NeedForm categories={categories} />
      </div>
    </div>
  );
}
