import { localizedMetadata } from "@/lib/i18n/serverMetadata";
import type { Metadata } from "next";
import ProtectedRoute from "@/components/shared/ProtectedRoute";
import VolunteerForm from "@/features/opportunities/components/VolunteerForm";

const pageMetadata: Metadata = {
  title: "Publish a volunteer opportunity",
  /* Signed-in or terminal screen: nothing here is useful in search
     results, and these routes ship their HTML to anyone because the
     guards are client-side. */
  robots: { index: false, follow: false },
};

export async function generateMetadata(): Promise<Metadata> {
  return localizedMetadata(pageMetadata);
}

export default function Page() {
  return (
    <ProtectedRoute publish="volunteer" publishNavStateKey="volunteer_form_details">
      <VolunteerForm />
    </ProtectedRoute>
  );
}
