new things
This commit is contained in:
@@ -8,6 +8,7 @@ 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 { LoadingSkeleton } from "@/components/loadingProduct";
|
||||
import { EmptyState } from "@/components/emptyState";
|
||||
import { ErrorState } from "@/components/errorState";
|
||||
@@ -32,6 +33,7 @@ function checkCategory(categoryName: string | undefined, lang: string) {
|
||||
}
|
||||
|
||||
export default function CarDetailPage() {
|
||||
const { t } = useTranslation();
|
||||
const [modalOpen, setModalOpen] = useState<boolean>(false);
|
||||
|
||||
const initialSubCategory = useSubCategory(
|
||||
@@ -107,7 +109,8 @@ export default function CarDetailPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const firstData = cars[0];
|
||||
const firstData = cars[0]?.data[0];
|
||||
console.log("First Data: ", firstData);
|
||||
|
||||
if (!firstData) {
|
||||
return (
|
||||
@@ -138,7 +141,7 @@ export default function CarDetailPage() {
|
||||
alt={firstData?.name ? firstData?.name : "image"}
|
||||
width={600}
|
||||
height={200}
|
||||
className="rounded-lg object-cover border border-gray-200 w-full"
|
||||
className="rounded-lg object-contain border border-gray-200 w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -147,7 +150,9 @@ export default function CarDetailPage() {
|
||||
<div className="text-lg font-semibold flex gap-2">
|
||||
{isMinimum ? <p>{text}</p> : <Text txt="hour-price" />} :
|
||||
<span className="font-medium flex gap-2 text-gray-500">
|
||||
{firstData.price?.toLocaleString("uz-UZ")}
|
||||
{firstData.price
|
||||
? Math.round(Number(firstData.price)).toLocaleString("ru-RU")
|
||||
: ""}
|
||||
<Text txt="wallet" />
|
||||
</span>
|
||||
</div>
|
||||
@@ -181,22 +186,24 @@ export default function CarDetailPage() {
|
||||
</div>
|
||||
|
||||
{/* Texnik xususiyatlar */}
|
||||
<div className="w-full border-t border-gray-300 pt-6">
|
||||
<h2 className="text-xl font-semibold mb-4 text-secondary">
|
||||
Texnik xususiyatlari
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 text-gray-700">
|
||||
{firstData?.features.map((item: any) => (
|
||||
<div
|
||||
key={item.id}
|
||||
className="p-3 rounded-md bg-gray-50 border border-gray-200 hover:bg-gray-100 transition"
|
||||
>
|
||||
<p className="font-medium">{item?.name}:</p>
|
||||
<p className="text-gray-600">{item?.value}</p>
|
||||
</div>
|
||||
))}
|
||||
{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">
|
||||
{t("tech-features")}
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 text-gray-700">
|
||||
{firstData?.features?.map((item: any) => (
|
||||
<div
|
||||
key={item.id}
|
||||
className="p-3 rounded-md bg-gray-50 border border-gray-200 hover:bg-gray-100 transition"
|
||||
>
|
||||
<p className="font-medium">{item?.name}:</p>
|
||||
<p className="text-gray-600">{item?.value}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Ijara modal */}
|
||||
<CarRentalModal
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { dir } from "i18next";
|
||||
import Header from "@/components/nav_foot/header";
|
||||
import Navbar from "@/components/nav_foot/navbar";
|
||||
import Footer from "@/components/nav_foot/footer";
|
||||
@@ -17,7 +16,7 @@ export default async function LangLayout({
|
||||
const { lang } = await params; // ✅ await bilan destructuring
|
||||
|
||||
return (
|
||||
<html lang={lang} dir="rtl">
|
||||
<html lang={lang} dir="rtl" suppressHydrationWarning>
|
||||
<body>
|
||||
<Suspense fallback={null}>
|
||||
<Header />
|
||||
@@ -29,7 +28,7 @@ export default async function LangLayout({
|
||||
</section>
|
||||
<Footer />
|
||||
<UpScrollIcon />
|
||||
<Time/>
|
||||
<Time />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user