import { LinkIncludingShortenedCollectionAndTags } from "@/types/global"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFileImage, faFilePdf } from "@fortawesome/free-regular-svg-icons"; import Image from "next/image"; import isValidUrl from "@/lib/shared/isValidUrl"; export default function LinkIcon({ link, className, }: { link: LinkIncludingShortenedCollectionAndTags; className?: string; }) { const url = isValidUrl(link.url || "") && link.url ? new URL(link.url) : undefined; const iconClasses: string = "bg-white text-primary shadow rounded-md border-[2px] border-white select-none z-10" + " " + className || ""; return (