feat: add product generation and pagination components
- Implemented product generation for categories with a helper function to create 50 products per category. - Added image assets for English and Persian language support. - Created a reusable Pagination component for navigating through product lists. - Developed ProductList component to display products with pagination support. - Defined TypeScript interfaces for product list props and API response structure.
This commit is contained in:
@@ -2,13 +2,10 @@ import Footer from '@/components/layout/footer/Footer';
|
||||
import '@/app/globals.css';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import { notFound } from 'next/navigation';
|
||||
// import { cookies } from 'next/headers';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import type { ILayoutLocaleParams } from '@/models/layout.d';
|
||||
|
||||
// export const metadata: Metadata = {
|
||||
// title: 'Create Next App',
|
||||
// description: 'Generated by create next app',
|
||||
// };
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
@@ -17,7 +14,12 @@ export default async function RootLayout({
|
||||
children: React.ReactNode;
|
||||
params: ILayoutLocaleParams;
|
||||
}>) {
|
||||
const locale = params.locale;
|
||||
const paramsData = await params;
|
||||
const locale = paramsData.locale;
|
||||
// const cookieStore = await cookies();
|
||||
|
||||
// // Set locale cookie on the server
|
||||
// cookieStore.set('locale', locale, { path: '/', httpOnly: false });
|
||||
|
||||
const fontClass = locale === 'fa' ? 'font-fa' : 'font-en';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user