diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-12-27 11:59:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-27 09:59:39 +0000 |
| commit | 267db791290f4f539d7bda113992e3d1690b0e8b (patch) | |
| tree | 0144ea00dcf6a49bdaaf46511cd074651aeeee5a /apps/web/components/dashboard/preview/LinkContentSection.tsx | |
| parent | bb6b742a040a70478d276529774bde67b8f93648 (diff) | |
| download | karakeep-267db791290f4f539d7bda113992e3d1690b0e8b.tar.zst | |
feat: support archiving as pdf (#2309)
* feat: support archiving as pdf
* add supprot for manually triggering pdf downloads
* fix submenu
* menu cleanup
* fix store pdf
Diffstat (limited to 'apps/web/components/dashboard/preview/LinkContentSection.tsx')
| -rw-r--r-- | apps/web/components/dashboard/preview/LinkContentSection.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx index bdf5faf1..5fb51784 100644 --- a/apps/web/components/dashboard/preview/LinkContentSection.tsx +++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx @@ -24,6 +24,7 @@ import { BookOpen, Camera, ExpandIcon, + FileText, Info, Video, } from "lucide-react"; @@ -104,6 +105,16 @@ function VideoSection({ link }: { link: ZBookmarkedLink }) { ); } +function PDFSection({ link }: { link: ZBookmarkedLink }) { + return ( + <iframe + title="PDF Viewer" + src={`/api/assets/${link.pdfAssetId}`} + className="relative h-full min-w-full" + /> + ); +} + export default function LinkContentSection({ bookmark, }: { @@ -154,6 +165,8 @@ export default function LinkContentSection({ content = <FullPageArchiveSection link={bookmark.content} />; } else if (section === "video") { content = <VideoSection link={bookmark.content} />; + } else if (section === "pdf") { + content = <PDFSection link={bookmark.content} />; } else { content = <ScreenshotSection link={bookmark.content} />; } @@ -198,6 +211,12 @@ export default function LinkContentSection({ {t("common.screenshot")} </div> </SelectItem> + <SelectItem value="pdf" disabled={!bookmark.content.pdfAssetId}> + <div className="flex items-center"> + <FileText className="mr-2 h-4 w-4" /> + {t("common.pdf")} + </div> + </SelectItem> <SelectItem value="archive" disabled={ |
