slider component updated

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-04-28 11:29:06 +05:00
parent cfa84d04ab
commit 77c6baaa55
25 changed files with 1308 additions and 1770 deletions

View File

@@ -4,7 +4,6 @@ import React, { useEffect, useState } from "react";
import Title from "../../lib_components/title";
import Text from "../../lib_components/text";
import type { ProductTypes } from "@/types";
import { allProducts } from "@/data";
import ProductCard from "../../cards/productCard";
import { LoadingSkeleton } from "@/components/loadingProduct";
import { EmptyState } from "@/components/emptyState";
@@ -45,15 +44,13 @@ export default function Products() {
} catch (error) {
console.log("Xatolik: ", error);
setError(error instanceof Error ? error.message : "Noma'lum xatolik");
// Xatolik bo'lsa ham local data'ni ko'rsatish
setCars(allProducts);
} finally {
setLoading(false);
}
};
fetchProducts();
}, [lang]); // Bo'sh array - faqat bitta marta ishlaydi
}, [lang]);
return (
<div dir="ltr" className="max-w-[1200px] w-full mx-auto">