import { Badge } from "@/components/ui/badge"; import { ImageCard, ImageCardBanner, ImageCardBody, ImageCardContent, ImageCardFooter, ImageCardTitle, } from "@/components/ui/imageCard"; import { ZBookmark } from "@/lib/types/api/bookmarks"; import Link from "next/link"; import BookmarkOptions from "./BookmarkOptions"; export default function LinkCard({ bookmark }: { bookmark: ZBookmark }) { const link = bookmark.content; const parsedUrl = new URL(link.url); // A dummy white pixel for when there's no image. // TODO: Better handling for cards with no images const image = link.imageUrl ?? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+P///38ACfsD/QVDRcoAAAAASUVORK5CYII="; return ( {link?.title ?? parsedUrl.host} {/* There's a hack here. Every tag has the full hight of the container itself. That why, when we enable flex-wrap, the overflowed don't show up. */} {bookmark.tags.map((t) => ( #{t.name} ))}
{parsedUrl.host}
); }