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

const Allegati: 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="grow p-4">
				<AllegatiComp isAdmin={session.user.isAdmin} userId={session.user.id} />
			</div>
		</>
	);
};
export default Allegati;

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