slider component updated
This commit is contained in:
@@ -6,12 +6,22 @@ import Link from "next/link";
|
||||
import Text from "../lib_components/text";
|
||||
import { motion } from "framer-motion";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useSubCategory } from "@/store/subCategory";
|
||||
|
||||
export default function SliderCard({ data }: { data: ProductTypes }) {
|
||||
const router = useParams();
|
||||
const setInitialSubcategory = useSubCategory(
|
||||
(state) => state.setInitialSubCategory,
|
||||
);
|
||||
return (
|
||||
<Link
|
||||
href={`/${router.lang}/${data.path}`}
|
||||
href={`/${router.lang}/${data.id}`}
|
||||
onClick={() => {
|
||||
setInitialSubcategory({
|
||||
name:data.truck_name,
|
||||
id: data.id,
|
||||
});
|
||||
}}
|
||||
id="news_slider_card"
|
||||
className="group hover:cursor-pointer block"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user