From 4402e6f04170cbb0613d35fe94471162253e91b2 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Fri, 19 Apr 2024 20:01:51 +0100 Subject: feature: Download images and screenshots --- .../dashboard/preview/TextContentSection.tsx | 40 +++++----------------- 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'apps/web/components/dashboard/preview/TextContentSection.tsx') diff --git a/apps/web/components/dashboard/preview/TextContentSection.tsx b/apps/web/components/dashboard/preview/TextContentSection.tsx index a73ad722..eba7d28b 100644 --- a/apps/web/components/dashboard/preview/TextContentSection.tsx +++ b/apps/web/components/dashboard/preview/TextContentSection.tsx @@ -4,36 +4,14 @@ import Markdown from "react-markdown"; import type { ZBookmark } from "@hoarder/shared/types/bookmarks"; export function TextContentSection({ bookmark }: { bookmark: ZBookmark }) { - let content; - switch (bookmark.content.type) { - case "link": { - if (!bookmark.content.htmlContent) { - content = ( -
- Failed to fetch link content ... -
- ); - } else { - content = ( -
- ); - } - break; - } - case "text": { - content = ( - - {bookmark.content.text} - - ); - break; - } + if (bookmark.content.type != "text") { + throw new Error("Invalid content type"); } - - return {content}; + return ( + + + {bookmark.content.text} + + + ); } -- cgit v1.2.3-70-g09d2