import type { Metadata } from "next";
import { SitePage } from "@/app/(site)/_components/SitePage";
import { SiteHeader } from "@/app/(site)/_components/SiteHeader";
import { SiteFooter } from "@/app/(site)/_components/SiteFooter";
import { SUSTAINABILITY_ESG_DEFAULTS } from "@/app/(site)/_components/pages/sustainability-esg/defaults";
import { SUSTAINABILITY_ESG_SECTIONS } from "@/app/(site)/_components/pages/sustainability-esg/sections";
import { renderSections } from "@/app/(site)/_components/pages/render";
import { getPage } from "@/app/(site)/_lib/cms";

export const metadata: Metadata = {
  title: "Sustainability & ESG — Unionists Group",
};

export default async function Page() {
  const data = await getPage("sustainability-esg");
  return (
    <SitePage className="sustainability-esg-page">
      <a className="skip-link" href="#main">
        Skip to main content
      </a>{" "}
      <SiteHeader active="/sustainability-esg" activeItem="/sustainability-esg" />
      <main id="main">{renderSections("sustainability-esg", data, SUSTAINABILITY_ESG_DEFAULTS, SUSTAINABILITY_ESG_SECTIONS)}</main>
      <SiteFooter />
    </SitePage>
  );
}
