aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/preview
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard/preview')
-rw-r--r--apps/web/components/dashboard/preview/AssetContentSection.tsx39
1 files changed, 22 insertions, 17 deletions
diff --git a/apps/web/components/dashboard/preview/AssetContentSection.tsx b/apps/web/components/dashboard/preview/AssetContentSection.tsx
index 3fbbc519..4a025f9d 100644
--- a/apps/web/components/dashboard/preview/AssetContentSection.tsx
+++ b/apps/web/components/dashboard/preview/AssetContentSection.tsx
@@ -7,25 +7,30 @@ export function AssetContentSection({ bookmark }: { bookmark: ZBookmark }) {
throw new Error("Invalid content type");
}
- let content;
switch (bookmark.content.assetType) {
case "image": {
- switch (bookmark.content.assetType) {
- case "image": {
- content = (
- <div className="relative h-full min-w-full">
- <Image
- alt="asset"
- fill={true}
- className="object-contain"
- src={`/api/assets/${bookmark.content.assetId}`}
- />
- </div>
- );
- }
- }
- break;
+ return (
+ <div className="relative h-full min-w-full">
+ <Image
+ alt="asset"
+ fill={true}
+ className="object-contain"
+ src={`/api/assets/${bookmark.content.assetId}`}
+ />
+ </div>
+ );
+ }
+ case "pdf": {
+ return (
+ <iframe
+ title={bookmark.content.assetId}
+ className="h-full w-full"
+ src={`/api/assets/${bookmark.content.assetId}`}
+ />
+ );
+ }
+ default: {
+ return <div>Unsupported asset type</div>;
}
}
- return content;
}