import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { CreatorOpportunityDetailPage } from "@/components/dashboard/CreatorOpportunityDetailPage";

export const metadata: Metadata = {
  title: "Campaign opportunity | Postvertise",
  description: "Review a campaign brief and apply or respond to an invitation.",
};

type PageProps = {
  params: Promise<{ campaignId: string }>;
};

export default async function Page({ params }: PageProps) {
  const { campaignId: raw } = await params;
  const campaignId = Number(raw);
  if (!Number.isInteger(campaignId) || campaignId < 1) {
    notFound();
  }

  return <CreatorOpportunityDetailPage campaignId={campaignId} />;
}
