import Head from "next/head";
import { EmailAccordion } from "~/components/area-riservata/comunicazioni";
import { AreaRiservataLayout } from "~/components/Layout";
import type { NextPageWithLayout } from "~/pages/_app";
import { useTranslation } from "~/providers/I18nProvider";
import { useEnforcedSession } from "~/providers/SessionProvider";

const Comunicazioni: NextPageWithLayout = () => {
	const { t } = useTranslation();
	const session = useEnforcedSession();

	return (
		<>
			<Head>
				<title>{t.heads.area_riservata_titolo}</title>
				<meta content={t.heads.area_riservata_description} name="description" />
			</Head>

			<div className="mx-auto max-w-7xl grow p-4">
				<div className="p-1">
					<h1 className="text-primary text-2xl font-bold">Comunicazioni</h1>
				</div>

				<EmailAccordion userId={session.user.id} />
			</div>
		</>
	);
};
export default Comunicazioni;

Comunicazioni.getLayout = function getLayout(page) {
	return <AreaRiservataLayout noFooter>{page}</AreaRiservataLayout>;
};
