diff --git a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx index 6d8e0bdc..5af11aa3 100644 --- a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx +++ b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx @@ -12,7 +12,7 @@ import { ZBookmark } from "@/lib/types/api/bookmarks"; import Link from "next/link"; import BookmarkOptions from "./BookmarkOptions"; import { api } from "@/lib/trpc"; -import { Star } from "lucide-react"; +import { Maximize2, Star } from "lucide-react"; import TagList from "./TagList"; function isStillCrawling(bookmark: ZBookmark) { @@ -91,7 +91,7 @@ export default function LinkCard({ -
+
)} + + +
diff --git a/packages/web/app/dashboard/bookmarks/components/TextCard.tsx b/packages/web/app/dashboard/bookmarks/components/TextCard.tsx index 8170a304..029800ac 100644 --- a/packages/web/app/dashboard/bookmarks/components/TextCard.tsx +++ b/packages/web/app/dashboard/bookmarks/components/TextCard.tsx @@ -10,6 +10,7 @@ import Markdown from "react-markdown"; import { useState } from "react"; import { BookmarkedTextViewer } from "./BookmarkedTextViewer"; import { Button } from "@/components/ui/button"; +import Link from "next/link"; function isStillTagging(bookmark: ZBookmark) { return ( @@ -82,13 +83,12 @@ export default function TextCard({ /> )}
- + diff --git a/packages/web/app/dashboard/preview/[bookmarkId]/page.tsx b/packages/web/app/dashboard/preview/[bookmarkId]/page.tsx new file mode 100644 index 00000000..030ad2df --- /dev/null +++ b/packages/web/app/dashboard/preview/[bookmarkId]/page.tsx @@ -0,0 +1,64 @@ +import { BackButton } from "@/components/ui/back-button"; +import { api } from "@/server/api/client"; +import { ArrowLeftCircle, CalendarDays, ExternalLink } from "lucide-react"; +import Link from "next/link"; +import Markdown from "react-markdown"; + +export default async function BookmarkPreviewPage({ + params, +}: { + params: { bookmarkId: string }; +}) { + const bookmark = await api.bookmarks.getBookmark({ + bookmarkId: params.bookmarkId, + }); + + const linkHeader = bookmark.content.type == "link" && ( +
+

{bookmark.content.title}

+ + View Original + + +
+ ); + + let content; + switch (bookmark.content.type) { + case "link": { + content = ( +
+ ); + break; + } + case "text": { + content = {bookmark.content.text}; + break; + } + } + + return ( +
+
+ + + +
+ + {bookmark.createdAt.toLocaleString()} + +
+
+
+ {linkHeader} +
+ {content} +
+
+ ); +} diff --git a/packages/web/components/ui/back-button.tsx b/packages/web/components/ui/back-button.tsx new file mode 100644 index 00000000..685930df --- /dev/null +++ b/packages/web/components/ui/back-button.tsx @@ -0,0 +1,9 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { Button, ButtonProps } from "./button"; + +export function BackButton({ ...props }: ButtonProps) { + const router = useRouter(); + return