blob: 6fa2a1cfc26ce79c3259bb521f8be66955d1f27d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
"use client";
import { MarkdownComponent } from "@/components/ui/markdown-component";
import { bookmarkLayoutSwitch } from "@/lib/userLocalSettings/bookmarksLayout";
import { cn } from "@/lib/utils";
import type { ZBookmarkTypeText } from "@hoarder/shared/types/bookmarks";
import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard";
export default function TextCard({
bookmark,
className,
}: {
bookmark: ZBookmarkTypeText;
className?: string;
}) {
const bookmarkedText = bookmark.content;
return (
<>
<BookmarkLayoutAdaptingCard
title={bookmark.title}
content={<MarkdownComponent>{bookmarkedText.text}</MarkdownComponent>}
footer={null}
wrapTags={true}
bookmark={bookmark}
className={className}
fitHeight={true}
image={(layout, className) =>
bookmarkLayoutSwitch(layout, {
grid: null,
masonry: null,
list: (
<div
className={cn(
"flex size-full items-center justify-center bg-accent text-center",
className,
)}
>
Note
</div>
),
})
}
/>
</>
);
}
|