slide
This commit is contained in:
@@ -5,12 +5,13 @@ import Link from "next/link";
|
||||
import Text from "../lib_components/text";
|
||||
import { useParams } from "next/navigation";
|
||||
import { motion } from "framer-motion";
|
||||
import { useCarType } from "@/store/carType";
|
||||
import { useSubCategory } from "@/store/subCategory";
|
||||
|
||||
export default function ProductCard({ data }: { data: any }) {
|
||||
const { lang } = useParams();
|
||||
|
||||
const setInitialCar = useCarType((state) => state.setInitialCar);
|
||||
const setInitialSubcategory = useSubCategory(
|
||||
(state) => state.setInitialSubCategory,
|
||||
);
|
||||
const carData = {
|
||||
name: data?.name,
|
||||
id: data?.id,
|
||||
@@ -32,7 +33,7 @@ export default function ProductCard({ data }: { data: any }) {
|
||||
>
|
||||
<Link
|
||||
href={`/${lang}/${data.name}`}
|
||||
onClick={() => setInitialCar(carData)}
|
||||
onClick={() => setInitialSubcategory(carData)}
|
||||
className="h-full flex flex-col items-center justify-between rounded-lg bg-white transition-transform"
|
||||
>
|
||||
{/* Yuqori qism - rasm */}
|
||||
|
||||
Reference in New Issue
Block a user