import { getLibEntryPaths, getLanguageMetadata } from "../../lib/library";

export async function generateStaticParams() {
  const paths = await getLibEntryPaths();
  return paths.map((path) => ({
    language: path.split("/").at(-1),
  }))
}


type Params = {
  params: {
    language: string;
  }
};

export default async function Page({ params }: Params) {
  const langMd = await getLanguageMetadata(params.language);
  return <>
    <h1>{params.language}</h1>
    <div className="overflow-y-auto pt-4 flex-auto border-slate-100 border-2">
      <pre>
        {JSON.stringify(langMd, null, 4)}
      </pre>
    </div>
  </>;
}
