import type { Metadata } from "next";
import { requireAuth } from "@/lib/auth/guards";
import { getEffectivePlan } from "@/lib/billing/subscription";
import { PageHeader } from "@/components/app/page-header";
import { EpisodeWizard } from "@/components/app/episode-wizard";

export const metadata: Metadata = { title: "Create an episode" };

export default async function NewEpisodePage() {
  const session = await requireAuth();
  const { plan } = await getEffectivePlan(session.user.id, session.session.activeOrganizationId);
  return (
    <>
      <PageHeader
        title="Create an episode"
        description="Configure your episode and let the AI write, record, and design it."
      />
      <EpisodeWizard maxMinutes={plan.limits.maxEpisodeMinutes} />
    </>
  );
}
