diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index a85a7ee..7b20782 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -5,10 +5,12 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronRight } from "@fortawesome/free-solid-svg-icons"; -import { Collection } from "@prisma/client"; import Link from "next/link"; +import { ExtendedCollection } from "@/types/global"; +import useLinkStore from "@/store/links"; -export default function ({ collection }: { collection: Collection }) { +export default function ({ collection }: { collection: ExtendedCollection }) { + const { links } = useLinkStore(); const formattedDate = new Date(collection.createdAt).toLocaleString("en-US", { year: "numeric", month: "short", @@ -17,20 +19,37 @@ export default function ({ collection }: { collection: Collection }) { return ( -
{collection.name}
+{collection.name}
- {collection.description} +
{collection.description}
+Members:
+ {collection.members.map((e, i) => { + return ( ++ {e.user.name} +
+ ); + })} +{formattedDate}
++ {links.filter((e) => e.collectionId === collection.id).length} Links
{formattedDate}
{collection.name}
+{collection.description}
+Members:
+ {collection.members.map((e, i) => { + return ( ++ {e.user.name} +
+ ); + })} +{formattedDate}
++ {links.filter((e) => e.collectionId === collection.id).length} Links +
+{count + 1}.
+{link.name}
+{link.title}
+{link.collection.name}
++ # {e.name} +
+ + ))} +{formattedDate}
+ +{url.host}
++ Dashboard +
+All Collections
+All Collections
+Sort by
+Dashboard
+{links.length}
+Links
++ {collections.length} +
+Collections
+{tags.length}
+Tags
+Recently added Links
+ +Top Collections
+ +Search Results
+ Nothing found.{" "} + + ¯\_(ツ)_/¯ + +
+ )}