'use client';

import useAlert from '../Alert/hooks/useAlert';
import Alert from '../Alert';
import useSilentAuth from '@/hooks/useSilentAuth';

export default function Layout({ children }: { children: React.ReactNode }) {
  const { alertOpen, alertContent, onCloseAlert } = useAlert();
  useSilentAuth();

  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>
  );
}
