"use client";
import Image from "next/image";
import Link from "next/link";
import type { ZBookmarkTypeLink } from "@hoarder/shared/types/bookmarks";
import {
getBookmarkLinkImageUrl,
getSourceUrl,
isBookmarkStillCrawling,
} from "@hoarder/shared-react/utils/bookmarkUtils";
import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard";
import FooterLinkURL from "./FooterLinkURL";
function LinkTitle({ bookmark }: { bookmark: ZBookmarkTypeLink }) {
const link = bookmark.content;
const parsedUrl = new URL(link.url);
return (
{bookmark.title ?? link?.title ?? parsedUrl.host}
);
}
function LinkImage({
bookmark,
className,
}: {
bookmark: ZBookmarkTypeLink;
className?: string;
}) {
const link = bookmark.content;
const imgComponent = (url: string, unoptimized: boolean) => (