import Image from "next/image"; // import data from "../../assets/dummyData.json"; import { BookOpenIcon as BookOpenSolid, PlayIcon, } from "@heroicons/react/24/solid"; import { useDraggable } from "react-use-draggable-scroll"; import { useRef } from "react"; import Link from "next/link"; import { BookOpenIcon as BookOpenOutline, PlayCircleIcon, } from "@heroicons/react/24/outline"; export default function UserRecommendation({ data }) { const mobileRef = useRef(null); const desktopRef = useRef(null); const { events: mobileEvent } = useDraggable(mobileRef); const { events: desktopEvent } = useDraggable(desktopRef); 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 (

{data[0].title.userPreferred}

]*>/g, ""), }} className="font-roboto font-light line-clamp-3 lg:line-clamp-3" /> {data[0].type === "ANIME" ? ( ) : ( )} {data[0].type === "ANIME" ? "Watch" : "Read"} Now

{filteredData.slice(0, 9).map((i) => ( {i.title.userPreferred}
{i.type === "ANIME" ? ( ) : ( )}
{i.title.userPreferred} {/*
{i.title.userPreferred}
a
*/} ))}
{filteredData.slice(0, 9).map((i) => (
{i.type === "ANIME" ? ( ) : ( )}
{i.title.userPreferred}

{i.status === "RELEASING" ? ( ) : i.status === "NOT_YET_RELEASED" ? ( ) : null} {i.title.userPreferred}

))}
{data[0]?.bannerImage && ( {data[0].title.userPreferred} )}
); }