This commit is contained in:
2026-03-13 13:54:45 +07:00
parent a8e30f32a0
commit 25111ff10e
120 changed files with 4213 additions and 4859 deletions

View File

@@ -1,5 +1,4 @@
'use client';
import { useState, useEffect } from 'react';
import type { Metadata } from 'next';
import '@styles/sf-pro-display.css';
import 'swiper/css';
import 'swiper/css/navigation';
@@ -7,32 +6,44 @@ import 'swiper/css/pagination';
import '@styles/globals.css';
import Header from '@/components/Other/Header';
import Footer from '@/components/Other/Footer';
import MSWProvider from '@/components/Common/MSWProvider';
import { ErrorBoundary } from '@/components/Common/ErrorBoundary';
import PreLoader from '@/components/Common/PreLoader';
export const metadata: Metadata = {
title: {
default: 'Nguyễn Công PC - Máy tính, Laptop, Linh kiện chính hãng',
template: '%s | Nguyễn Công PC',
},
description:
'Nguyễn Công PC - Chuyên cung cấp máy tính, laptop, linh kiện, phụ kiện chính hãng với giá tốt nhất thị trường. Bảo hành uy tín, giao hàng nhanh toàn quốc.',
keywords: ['máy tính', 'laptop', 'linh kiện máy tính', 'nguyễn công pc', 'pc gaming'],
authors: [{ name: 'Nguyễn Công PC' }],
openGraph: {
type: 'website',
locale: 'vi_VN',
siteName: 'Nguyễn Công PC',
title: 'Nguyễn Công PC - Máy tính, Laptop, Linh kiện chính hãng',
description:
'Chuyên cung cấp máy tính, laptop, linh kiện, phụ kiện chính hãng với giá tốt nhất.',
},
robots: { index: true, follow: true },
};
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 />
</>
)}
<Header />
<MSWProvider>
<main>
<ErrorBoundary>{children}</ErrorBoundary>
</main>
</MSWProvider>
<Footer />
</body>
</html>
);