import type { Metadata } from "next";
import { getAllUniversiteSlugs } from "@/lib/katalog";
import { UniversiteIcerik, uniSayfaMetadata } from "./universite-icerik";

export function generateStaticParams() {
  return getAllUniversiteSlugs().map((slug) => ({ slug }));
}

export async function generateMetadata({
  params,
}: {
  params: Promise<{ slug: string }>;
}): Promise<Metadata> {
  const { slug } = await params;
  return uniSayfaMetadata(slug, 1);
}

export default async function UniversitePage({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  return <UniversiteIcerik slug={slug} sayfa={1} />;
}
