40 lines
883 B
TypeScript
40 lines
883 B
TypeScript
'use client';
|
|
import { useState, useEffect } from 'react';
|
|
import '@styles/sf-pro-display.css';
|
|
import 'swiper/css';
|
|
import 'swiper/css/navigation';
|
|
import 'swiper/css/pagination';
|
|
import '@styles/globals.css';
|
|
import Header from '@/components/layout/other/Header';
|
|
import Footer from '@/components/layout/other/Footer';
|
|
|
|
import PreLoader from '@components/common/PreLoader';
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const [loading, setLoading] = useState<boolean>(true);
|
|
|
|
useEffect(() => {
|
|
setTimeout(() => setLoading(false), 1000);
|
|
}, []);
|
|
|
|
return (
|
|
<html suppressHydrationWarning>
|
|
<body>
|
|
{loading ? (
|
|
<PreLoader />
|
|
) : (
|
|
<>
|
|
<Header />
|
|
<main>{children}</main>
|
|
<Footer />
|
|
</>
|
|
)}
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|