aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/preview/BookmarkPreview.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard/preview/BookmarkPreview.tsx')
-rw-r--r--apps/web/components/dashboard/preview/BookmarkPreview.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/web/components/dashboard/preview/BookmarkPreview.tsx b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
index 581ec4bd..3d98dd19 100644
--- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx
+++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
@@ -3,6 +3,7 @@
import { useEffect, useState } from "react";
import Link from "next/link";
import { TagsEditor } from "@/components/dashboard/bookmarks/TagsEditor";
+import { FullPageSpinner } from "@/components/ui/full-page-spinner";
import { Separator } from "@/components/ui/separator";
import { Skeleton } from "@/components/ui/skeleton";
import {
@@ -65,13 +66,15 @@ function CreationTime({ createdAt }: { createdAt: Date }) {
}
export default function BookmarkPreview({
+ bookmarkId,
initialData,
}: {
- initialData: ZBookmark;
+ bookmarkId: string;
+ initialData?: ZBookmark;
}) {
const { data: bookmark } = api.bookmarks.getBookmark.useQuery(
{
- bookmarkId: initialData.id,
+ bookmarkId,
},
{
initialData,
@@ -89,6 +92,10 @@ export default function BookmarkPreview({
},
);
+ if (!bookmark) {
+ return <FullPageSpinner />;
+ }
+
let content;
switch (bookmark.content.type) {
case "link": {