import { useAutoAnimate } from "@formkit/auto-animate/react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { getIfBookmarkedFromPortable, useBookmarkContext, } from "@/state/bookmark"; import { useWatchedContext } from "@/state/watched"; function Watched() { const { t } = useTranslation(); const { getFilteredBookmarks } = useBookmarkContext(); const { getFilteredWatched, removeProgress } = useWatchedContext(); const [editing, setEditing] = useState(false); const [gridRef] = useAutoAnimate(); const bookmarks = getFilteredBookmarks(); const watchedItems = getFilteredWatched().filter( (v) => !getIfBookmarkedFromPortable(bookmarks, v.item.meta) ); if (watchedItems.length === 0) return null; return (
{watchedItems.map((v) => ( removeProgress(v.item.meta.id)} /> ))}
); }