import { Metadata } from "next";
import { notFound } from "next/navigation";
import regionsCpts from "../../../regions_cpts.json";
import regions, { getRegionFromSlug, getSlugFromRegion } from "@/lib/regions";
import { Header, DepartementsList, RegionList } from "@/components/index";
import {
Content,
ContentHeader,
ContentBody,
ContentFull,
ContentHalf,
} from "@/components/Content/Content";
import { getCommuneFromCodePostal } from "@/lib/communes";
import Link from "next/link";
export const metadata: Metadata = {
title: "Annuaire",
description: "L'annuaire collaboratif des professionnels de la santé",
};
export async function generateStaticParams() {
return regions.map((region) => ({
region: getSlugFromRegion(region),
}));
}
export default function RegionPage({
params,
}: {
params: { regionSlug: string };
}) {
const region = getRegionFromSlug(params.regionSlug);
if (!region) return notFound();
// const nbHabitants = getCommuesFromRegion()
return (
<>
{getCommuneFromCodePostal(region.chefLieu).nom}
{region.nom}
Nombre de départements
Nombre d'habitants
Nombre de SISA
Nombre de CPTS
Nombre de SISA