el.xwx.moe/pages/collections/[id].tsx

22 lines
530 B
TypeScript
Raw Normal View History

2023-03-05 15:03:20 -06:00
import LinkList from "@/components/LinkList";
2023-03-22 18:11:54 -05:00
import useLinkStore from "@/store/links";
import { useRouter } from "next/router";
export default function () {
const router = useRouter();
2023-03-22 18:11:54 -05:00
const { links } = useLinkStore();
2023-03-05 15:03:20 -06:00
const linksByCollection = links.filter(
(e) => e.collectionId === Number(router.query.id)
);
2023-03-05 15:03:20 -06:00
return (
// ml-80
2023-03-28 02:31:50 -05:00
<div className="p-5 flex flex-col gap-5 w-full">
2023-03-05 15:03:20 -06:00
{linksByCollection.map((e, i) => {
return <LinkList key={i} link={e} count={i} />;
})}
</div>
);
}