2025-06-02 16:45:30 +03:30
|
|
|
import images from '@/assets/images/images';
|
|
|
|
|
import SectionTitle from '@/components/layout/sectionTitle';
|
2025-06-05 16:03:59 +03:30
|
|
|
import type { IProductCategoryCardProps } from '../productCategories/productCategoryCard.d';
|
|
|
|
|
import { getProductCategories } from '@/services/products';
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import routeFactory from '@/assets/constants/routeFactory';
|
2025-06-07 16:31:52 +03:30
|
|
|
import { getTranslations } from 'next-intl/server';
|
|
|
|
|
import { ILayoutLocaleParams } from '@/models/layout';
|
|
|
|
|
import { TLocales } from '@/locales/translates';
|
2025-06-02 16:45:30 +03:30
|
|
|
|
2025-06-07 16:31:52 +03:30
|
|
|
interface Props {
|
|
|
|
|
locale: TLocales;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default async function HomePageProducts({ locale }: Props) {
|
|
|
|
|
const t = await getTranslations({ locale });
|
2025-06-05 16:03:59 +03:30
|
|
|
const productCategories: IProductCategoryCardProps[] =
|
|
|
|
|
await getProductCategories();
|
2025-06-07 16:31:52 +03:30
|
|
|
const routes = routeFactory(t, locale);
|
2025-06-02 16:45:30 +03:30
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="w-full">
|
|
|
|
|
<div
|
|
|
|
|
className={`relative w-full bg-cover bg-fixed bg-center bg-no-repeat pt-28 pb-48`}
|
2025-06-02 18:06:15 +03:30
|
|
|
style={{ backgroundImage: `url(${images.homeProductBack.src})` }}
|
2025-06-02 16:45:30 +03:30
|
|
|
>
|
|
|
|
|
<div className="absolute inset-0 z-10 bg-black opacity-50" />
|
|
|
|
|
<div className="relative z-20 container mx-auto grid grid-cols-2 gap-28">
|
|
|
|
|
<SectionTitle
|
2025-06-07 16:31:52 +03:30
|
|
|
title={t('pages_product_categories_title')}
|
|
|
|
|
description={t('com_home_products_title')}
|
2025-06-02 16:45:30 +03:30
|
|
|
reverseColor
|
|
|
|
|
/>
|
|
|
|
|
<h4 className="pt-10 text-base font-extralight tracking-normal text-white">
|
2025-06-07 16:31:52 +03:30
|
|
|
{t('com_home_products_description')}
|
2025-06-02 16:45:30 +03:30
|
|
|
</h4>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="relative top-[-100px] z-20 container mx-auto w-full">
|
|
|
|
|
<div className="grid grid-cols-1 gap-8 rounded-4xl bg-gray-50 py-10 shadow-2xl md:grid-cols-2 lg:grid-cols-4">
|
|
|
|
|
{productCategories.map((category, index) => (
|
2025-06-07 16:31:52 +03:30
|
|
|
<Link key={category.id} href={routes.products.route(category.id)}>
|
2025-06-05 16:03:59 +03:30
|
|
|
<div
|
|
|
|
|
className={`flex flex-col items-center justify-center gap-4 p-6 text-center ${index ? 'border-s-[1px] border-gray-100' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<h3 className="text-xl font-bold text-gray-500">
|
|
|
|
|
{category.title}
|
|
|
|
|
</h3>
|
|
|
|
|
<p className="text-lg font-light text-gray-400">
|
2025-06-07 16:31:52 +03:30
|
|
|
{t('com_products_category_types_count', {
|
|
|
|
|
count: category.typesCount,
|
|
|
|
|
})}
|
2025-06-05 16:03:59 +03:30
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
2025-06-02 16:45:30 +03:30
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|