Update LinkCard.tsx
This commit is contained in:
parent
ce9b4b05d4
commit
7c35fe409f
|
@ -5,13 +5,8 @@ import {
|
|||
import { faLink } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useEffect, useState } from "react";
|
||||
import Image from "next/image";
|
||||
import useLinkStore from "@/store/links";
|
||||
import useCollectionStore from "@/store/collections";
|
||||
import {
|
||||
faFileImage,
|
||||
faFilePdf,
|
||||
} from "@fortawesome/free-regular-svg-icons";
|
||||
import isValidUrl from "@/lib/shared/isValidUrl";
|
||||
import unescapeString from "@/lib/client/unescapeString";
|
||||
import LinkActions from "@/components/LinkViews/LinkComponents/LinkActions";
|
||||
|
@ -33,15 +28,15 @@ export default function LinkCard({link, count, className}: Props) {
|
|||
const [collection, setCollection] =
|
||||
useState<CollectionIncludingMembersAndLinkCount>(
|
||||
collections.find(
|
||||
(e) => e.id === link.collection.id
|
||||
) as CollectionIncludingMembersAndLinkCount
|
||||
(e) => e.id === link.collection.id,
|
||||
) as CollectionIncludingMembersAndLinkCount,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setCollection(
|
||||
collections.find(
|
||||
(e) => e.id === link.collection.id
|
||||
) as CollectionIncludingMembersAndLinkCount
|
||||
(e) => e.id === link.collection.id,
|
||||
) as CollectionIncludingMembersAndLinkCount,
|
||||
);
|
||||
}, [collections, links]);
|
||||
|
||||
|
|
Ŝarĝante…
Reference in New Issue