slider component updated
This commit is contained in:
@@ -8,11 +8,10 @@ import { usePathname, useParams } from "next/navigation";
|
||||
import { logoImg } from "@/assets";
|
||||
import { useSubCategory } from "@/store/subCategory";
|
||||
import { minimumValues } from "@/data/minimimValues";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { LoadingSkeleton } from "@/components/loadingProduct";
|
||||
import { EmptyState } from "@/components/emptyState";
|
||||
import { ErrorState } from "@/components/errorState";
|
||||
// for gitea
|
||||
|
||||
const baseUrl = "https://api.spes-texnika.uz/api/v1/products/";
|
||||
|
||||
@@ -33,7 +32,7 @@ function checkCategory(categoryName: string | undefined, lang: string) {
|
||||
}
|
||||
|
||||
export default function CarDetailPage() {
|
||||
const { t } = useTranslation();
|
||||
const t = useTranslations();
|
||||
const [modalOpen, setModalOpen] = useState<boolean>(false);
|
||||
|
||||
const initialSubCategory = useSubCategory(
|
||||
@@ -127,14 +126,11 @@ export default function CarDetailPage() {
|
||||
dir="ltr"
|
||||
className="my-10 max-w-[1200px] w-full mx-auto space-y-8 flex flex-col items-start justify-center px-2"
|
||||
>
|
||||
{/* Mashina nomi */}
|
||||
<div className="text-2xl font-bold w-full text-center text-secondary mb-10">
|
||||
<Text txt={""} />
|
||||
</div>
|
||||
|
||||
{/* Rasmi + asosiy narx ma'lumotlari */}
|
||||
<div className="flex flex-col md:flex-row md:items-start items-center gap-6 justify-center w-full">
|
||||
{/* Mashina rasmi */}
|
||||
<div className="max-w-[600px] w-full h-auto">
|
||||
<Image
|
||||
src={firstData?.image ? firstData?.image : logoImg}
|
||||
@@ -145,7 +141,6 @@ export default function CarDetailPage() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Asosiy ma'lumotlar */}
|
||||
<div className="lg:space-y-6 space-y-3 w-full">
|
||||
<div className="text-lg font-semibold flex gap-2">
|
||||
{isMinimum ? <p>{text}</p> : <Text txt="hour-price" />} :
|
||||
@@ -166,13 +161,11 @@ export default function CarDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Izoh */}
|
||||
<div className="space-y-2 text-gray-500 text-lg">
|
||||
<Text txt="note1" />
|
||||
<Text txt="note2" />
|
||||
</div>
|
||||
|
||||
{/* Buyurtma tugmasi */}
|
||||
<div className="flex gap-6">
|
||||
<button
|
||||
onClick={() => setModalOpen(true)}
|
||||
@@ -185,7 +178,6 @@ export default function CarDetailPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Texnik xususiyatlar */}
|
||||
{firstData?.features.length > 0 && (
|
||||
<div className="w-full border-t border-gray-300 pt-6">
|
||||
<h2 className="text-xl font-semibold mb-4 text-secondary">
|
||||
@@ -205,7 +197,6 @@ export default function CarDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Ijara modal */}
|
||||
<CarRentalModal
|
||||
car={firstData}
|
||||
isOpen={modalOpen}
|
||||
|
||||
@@ -5,30 +5,35 @@ import Contact from "@/components/pageParts/contact";
|
||||
import UpScrollIcon from "@/components/lib_components/upScroll";
|
||||
import { Suspense } from "react";
|
||||
import Time from "@/components/lib_components/time";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getMessages } from "next-intl/server";
|
||||
|
||||
export default async function LangLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ lang: string }>; // ✅ Promise shaklda
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params; // ✅ await bilan destructuring
|
||||
const { lang } = await params;
|
||||
const messages = await getMessages();
|
||||
|
||||
return (
|
||||
<html lang={lang} dir="rtl" suppressHydrationWarning>
|
||||
<body>
|
||||
<Suspense fallback={null}>
|
||||
<Header />
|
||||
</Suspense>
|
||||
<Navbar />
|
||||
{children}
|
||||
<section id="contact">
|
||||
<Contact />
|
||||
</section>
|
||||
<Footer />
|
||||
<UpScrollIcon />
|
||||
<Time />
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<Suspense fallback={null}>
|
||||
<Header />
|
||||
</Suspense>
|
||||
<Navbar />
|
||||
{children}
|
||||
<section id="contact">
|
||||
<Contact />
|
||||
</section>
|
||||
<Footer />
|
||||
<UpScrollIcon />
|
||||
<Time />
|
||||
</NextIntlClientProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user