Files
nguyencongpc_nextjs/src/app/(size)/layout.tsx

40 lines
870 B
TypeScript
Raw Normal View History

2025-12-19 11:32:50 +07:00
'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';
2025-12-23 15:29:31 +07:00
import Header from '@/components/layout/other/Header';
import Footer from '@/components/layout/other/Footer';
2025-12-19 11:32:50 +07:00
2025-12-22 17:30:27 +07:00
import PreLoader from '@components/common/PreLoader';
2025-12-19 11:32:50 +07:00
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 />
{children}
2025-12-23 15:29:31 +07:00
<Footer />
2025-12-19 11:32:50 +07:00
</>
)}
</body>
</html>
);
}