import EditSEOForm from "./EditSEOForm";

// Next.js expects the params prop to be synchronous, but sometimes type generation expects Promise<{ params }>
// To ensure compatibility, add a type alias for the props and use it for both exports
type EditSEOPageProps = { params: { type: string; id: string } };

// Next.js 15+ expects params to be a Promise in some cases due to previous type pollution.
// To work around this, force params to be a Promise in the type signature.

export async function generateMetadata({ params }: { params: Promise<{ type: string; id: string }> }) {
  const { type, id } = await params;
  return {
    title: `Edit SEO - ${type}`,
    description: `Edit SEO metadata for ${type} page.`,
  };
}

export default async function EditSEOPage({ params }: { params: Promise<{ type: string; id: string }> }) {
  const { type, id } = await params;
  return <EditSEOForm type={type} id={id} />;
}
