feat(Menu,Lang,Image): fix bug menu and change lang and set images

This commit is contained in:
2026-05-22 13:35:28 +03:30
parent 7d30e4f180
commit 4d995a61af
11 changed files with 176 additions and 92 deletions

View File

@@ -1,7 +1,6 @@
import Image from 'next/image'
import CategoryImage from '../public/img.png'
import { equipmentImages } from '@/lib/localImages'
async function getData(id) {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/content/index/${id}`)
@@ -24,7 +23,7 @@ export default async function Production({ lang }){
}
return(
<div className=" flex flex-col h-fit py-16">
<div id="production" className="flex h-fit scroll-mt-28 flex-col py-16">
<div className='flex flex-col lg:flex-row items-center justify-between font-[5] lg:mx-28 pb-12 lg:py-20 px-4'>
<div className='flex flex-col'>
<span className=''>{ data.equipmentSuper?.[0]?.body || '' }</span>
@@ -63,34 +62,34 @@ export default async function Production({ lang }){
{ data.equipmentDesc?.[0]?.body || '' }
</p>
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 grid-rows-2 bg-zinc-100 font-[5]">
<div className="flex w-full">
<Image alt="" src={ data.equipment3Image?.[0]?.body || '' } width={500} height={500} className="object-cover aspect-square w-1/2"/>
<div className="flex flex-col justify-center lg:p-10 sm:p-4 md:p-8 p-2 text-sm sm:text-base">
<span classname="font-[4] text-black-1 text-2xl pb-8"> { data.equipment3Title?.[0]?.body || '' }</span>
<p classname="font-[5] text- text-black-1">{ data.equipment3Desc?.[0]?.body || '' }</p>
<div className="grid grid-cols-1 bg-zinc-100 font-[5] lg:grid-cols-2">
<div className="flex min-h-[220px] w-full overflow-hidden">
<Image alt="" src={equipmentImages[0]} width={500} height={500} className="min-h-[220px] w-1/2 object-cover"/>
<div className="flex w-1/2 flex-col justify-center p-4 text-sm sm:p-6 sm:text-base lg:p-10">
<span className="pb-4 font-[4] text-xl text-black-1 lg:text-2xl"> { data.equipment3Title?.[0]?.body || '' }</span>
<p className="font-[5] text-black-1">{ data.equipment3Desc?.[0]?.body || '' }</p>
</div>
</div>
<div className="flex w-full flex-row-reverse lg:flex-row">
<Image alt="" src={ data.equipment3Image?.[1]?.body || '' } width={500} height={500} className="object-cover aspect-square w-1/2"/>
<div className="flex flex-col justify-center lg:p-10 sm:p-4 md:p-8 p-2 text-sm sm:text-base">
<span classname="font-[4] text-black-1 text-2xl pb-8"> { data.equipment3Title?.[1]?.body || '' }</span>
<p classname="font-[5] text- text-black-1">{ data.equipment3Desc?.[1]?.body || '' }</p>
<div className="flex min-h-[220px] w-full flex-row-reverse overflow-hidden lg:flex-row">
<Image alt="" src={equipmentImages[1]} width={500} height={500} className="min-h-[220px] w-1/2 object-cover"/>
<div className="flex w-1/2 flex-col justify-center p-4 text-sm sm:p-6 sm:text-base lg:p-10">
<span className="pb-4 font-[4] text-xl text-black-1 lg:text-2xl"> { data.equipment3Title?.[1]?.body || '' }</span>
<p className="font-[5] text-black-1">{ data.equipment3Desc?.[1]?.body || '' }</p>
</div>
</div>
<div className="flex w-full flex-row-reverse lg:flex-row">
<div className="flex flex-col justify-center lg:p-10 sm:p-4 md:p-8 p-2 text-sm sm:text-base">
<span classname="font-[4] text-black-1 text-2xl pb-8"> { data.equipment3Title?.[2]?.body || '' }</span>
<p classname="font-[5] text- text-black-1">{ data.equipment3Desc?.[2]?.body || '' }</p>
<div className="flex min-h-[220px] w-full flex-row-reverse overflow-hidden lg:flex-row">
<div className="flex w-1/2 flex-col justify-center p-4 text-sm sm:p-6 sm:text-base lg:p-10">
<span className="pb-4 font-[4] text-xl text-black-1 lg:text-2xl"> { data.equipment3Title?.[2]?.body || '' }</span>
<p className="font-[5] text-black-1">{ data.equipment3Desc?.[2]?.body || '' }</p>
</div>
<Image alt="" src={ data.equipment3Image?.[2]?.body || '' } width={500} height={500} className="object-cover aspect-square w-1/2"/>
<Image alt="" src={equipmentImages[2]} width={500} height={500} className="min-h-[220px] w-1/2 object-cover"/>
</div>
<div className="flex w-full">
<div className="flex flex-col justify-center lg:p-10 sm:p-4 md:p-8 p-2 text-sm sm:text-base">
<span classname="font-[4] text-black-1 text-2xl pb-8"> { data.equipment3Title?.[3]?.body || '' }</span>
<p classname="font-[5] text- text-black-1">{ data.equipment3Desc?.[3]?.body || '' }</p>
<div className="flex min-h-[220px] w-full overflow-hidden">
<div className="flex w-1/2 flex-col justify-center p-4 text-sm sm:p-6 sm:text-base lg:p-10">
<span className="pb-4 font-[4] text-xl text-black-1 lg:text-2xl"> { data.equipment3Title?.[3]?.body || '' }</span>
<p className="font-[5] text-black-1">{ data.equipment3Desc?.[3]?.body || '' }</p>
</div>
<Image alt="" src={ data.equipment3Image?.[3]?.body || '' } width={500} height={500} className="object-cover aspect-square w-1/2"/>
<Image alt="" src={equipmentImages[3]} width={500} height={500} className="min-h-[220px] w-1/2 object-cover"/>
</div>
</div>