import { useNavigate } from "react-router-dom"; import { api } from "../api.js"; export default function LibraryMarquee({ items = [] }) { const navigate = useNavigate(); const list = items.filter((x) => x && x.coverImage); if (!list.length) return null; const rowA = list.slice(0, 15); // Second row usually offsets by 10; fall back to row A when the library is // too small so the reverse row never renders empty. const rowB = list.length > 10 ? list.slice(10, 25) : rowA; return (
A LIBRARY THAT KEEPS MOVING
{rowA.concat(rowA).map((item, idx) => (
navigate(`/anime/${item.id}`)}> {item.id}
))}
{rowB.concat(rowB).map((item, idx) => (
navigate(`/anime/${item.id}`)}> {item.id}
))}
); }