From 14e4fed321634dc014ad2f15cafef3ed0123855e Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 23 Feb 2025 22:50:12 +0000 Subject: feat: Add a setting page to manage assets. Fixes #730 --- .../components/dashboard/preview/AttachmentBox.tsx | 35 ++++------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'apps/web/components/dashboard') diff --git a/apps/web/components/dashboard/preview/AttachmentBox.tsx b/apps/web/components/dashboard/preview/AttachmentBox.tsx index 32939cb0..19622f8d 100644 --- a/apps/web/components/dashboard/preview/AttachmentBox.tsx +++ b/apps/web/components/dashboard/preview/AttachmentBox.tsx @@ -9,32 +9,18 @@ import { } from "@/components/ui/collapsible"; import FilePickerButton from "@/components/ui/file-picker-button"; import { toast } from "@/components/ui/use-toast"; +import { ASSET_TYPE_TO_ICON } from "@/lib/attachments"; import useUpload from "@/lib/hooks/upload-file"; import { useTranslation } from "@/lib/i18n/client"; -import { - Archive, - Camera, - ChevronsDownUp, - Download, - Image, - Paperclip, - Pencil, - Plus, - Trash2, - Video, -} from "lucide-react"; +import { ChevronsDownUp, Download, Pencil, Plus, Trash2 } from "lucide-react"; import { useAttachBookmarkAsset, useDetachBookmarkAsset, useReplaceBookmarkAsset, -} from "@hoarder/shared-react/hooks/bookmarks"; +} from "@hoarder/shared-react/hooks/assets"; import { getAssetUrl } from "@hoarder/shared-react/utils/assetUtils"; -import { - BookmarkTypes, - ZAssetType, - ZBookmark, -} from "@hoarder/shared/types/bookmarks"; +import { BookmarkTypes, ZBookmark } from "@hoarder/shared/types/bookmarks"; import { humanFriendlyNameForAssertType, isAllowedToAttachAsset, @@ -43,17 +29,6 @@ import { export default function AttachmentBox({ bookmark }: { bookmark: ZBookmark }) { const { t } = useTranslation(); - const typeToIcon: Record = { - screenshot: , - assetScreenshot: , - fullPageArchive: , - precrawledArchive: , - bannerImage: , - video: