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 {
BookmarkTypes,
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};
}
function VideoSection({ link }: { link: ZBookmarkedLink }) {
return (
{/* eslint-disable-next-line jsx-a11y/media-has-caption -- captions not (yet) available */}
);
}
export default function LinkContentSection({
bookmark,
}: {
bookmark: ZBookmark;
}) {
const [section, setSection] = useState("cached");
if (bookmark.content.type != BookmarkTypes.LINK) {
throw new Error("Invalid content type");
}
let content;
if (section === "cached") {
content = ;
} else if (section === "archive") {
content = ;
} else if (section === "video") {
content = ;
} else {
content = ;
}
return (
{content}
);
}