feat: support nip 89

This commit is contained in:
2024-01-04 15:10:52 +07:00
parent 542b6033c2
commit 2726bfd595
5 changed files with 131 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
import { cn } from "@lume/utils";
import { NDKKind } from "@nostr-dev-kit/ndk";
import { useNoteContext, useRichContent } from "../..";
import { NIP89 } from "./nip89";
export function NoteContent({
className,
@@ -10,18 +11,7 @@ export function NoteContent({
const event = useNoteContext();
const { parsedContent } = useRichContent(event.content);
if (event.kind === NDKKind.Text) {
return (
<div
className={cn(
"break-p select-text whitespace-pre-line text-balance leading-normal",
className,
)}
>
{parsedContent}
</div>
);
}
if (event.kind !== NDKKind.Text) return <NIP89 className={className} />;
return (
<div
@@ -30,7 +20,7 @@ export function NoteContent({
className,
)}
>
Unsupported kind
{parsedContent}
</div>
);
}