import { useState } from "react";
import Image from "next/image";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { ScrollArea } from "@radix-ui/react-scroll-area";
import { ZBookmark, ZBookmarkedLink } from "@hoarder/shared/types/bookmarks";
function FullPageArchiveSection({ link }: { link: ZBookmarkedLink }) {
return (
);
}
function ScreenshotSection({ link }: { link: ZBookmarkedLink }) {
return (
);
}
function CachedContentSection({ link }: { link: ZBookmarkedLink }) {
let content;
if (!link.htmlContent) {
content = (
Failed to fetch link content ...
);
} else {
content = (
);
}
return {content};
}
export default function LinkContentSection({
bookmark,
}: {
bookmark: ZBookmark;
}) {
const [section, setSection] = useState("cached");
if (bookmark.content.type != "link") {
throw new Error("Invalid content type");
}
let content;
if (section === "cached") {
content = ;
} else if (section === "archive") {
content = ;
} else {
content = ;
}
return (
{content}
);
}