slider component updated
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user