import Image from "next/image"; // import data from "../../assets/dummyData.json"; import { BookOpenIcon, PlayIcon } from "@heroicons/react/24/solid"; import { useDraggable } from "react-use-draggable-scroll"; import { useRef } from "react"; import Link from "next/link"; export default function UserRecommendation({ data }) { const ref = useRef(null); const { events } = useDraggable(ref); const uniqueRecommendationIds = new Set(); // Filter out duplicates from the recommendations array const filteredData = data.filter((recommendation) => { // Check if the ID is already in the set if (uniqueRecommendationIds.has(recommendation.id)) { // If it's a duplicate, return false to exclude it from the filtered array return false; } // If it's not a duplicate, add the ID to the set and return true uniqueRecommendationIds.add(recommendation.id); return true; }); return (
]*>/g, ""), }} className="font-roboto font-light line-clamp-3 lg:line-clamp-3" />