gseps-front/src/components/Layout/Layout.tsx

26 lines
634 B
TypeScript
Raw Normal View History

2023-09-06 05:00:01 +00:00
'use client';
2023-08-23 08:12:52 +00:00
import useAlert from '../Alert/hooks/useAlert';
import Alert from '../Alert';
2023-09-06 05:00:01 +00:00
import useSilentAuth from '@/hooks/useSilentAuth';
2023-08-23 08:12:52 +00:00
2023-09-06 05:00:01 +00:00
export default function Layout({ children }: { children: React.ReactNode }) {
2023-08-23 08:12:52 +00:00
const { alertOpen, alertContent, onCloseAlert } = useAlert();
2023-09-06 05:00:01 +00:00
useSilentAuth();
2023-08-23 08:12:52 +00:00
return (
<div className="w-full overflow-hidden">
<div className="flex pt-14">
<main className={`w-full p-12`}>{children}</main>
</div>
<Alert
open={alertOpen}
onClose={onCloseAlert}
title={alertContent.title}
body={alertContent.body}
/>
</div>
);
}