- {parsedContent.elements.map((element, index) => {
- if (element.type === 'text') {
- return (
-
- {element.content}
-
- )
- }
-
- if (element.type === 'gallery' && element.images) {
- return (
-
-
-
- )
- }
-
- if (element.type === 'video' && element.mediaUrl) {
- return (
-
- )
- }
-
- if (element.type === 'audio' && element.mediaUrl) {
- return (
-
- )
- }
-
- if (element.type === 'hashtag' && element.hashtag) {
- const normalizedHashtag = element.hashtag.toLowerCase()
- // Only render as green link if this hashtag was parsed from the content
- // (parseNostrContent already only extracts hashtags from content, not t-tags)
- const nextElement = parsedContent.elements[index + 1]
- const shouldAddSpace = nextElement && nextElement.type === 'hashtag'
-
- return (
- <>
-
- #{element.hashtag}
-
- {shouldAddSpace &&
}
- >
- )
- }
-
- if (element.type === 'bookstr-wikilink' && element.bookstrWikilink) {
- return (
-
- )
- }
-
- if (element.type === 'wikilink' && element.wikilink && element.displayText) {
- const normalizedWikilink = element.wikilink.toLowerCase()
- return (
-
- {element.displayText}
-
- )
- }
-
- if (element.type === 'url' && element.url) {
- return (
-
- )
- }
-
- if (element.type === 'payto' && element.paytoUri) {
- return (
-
- )
- }
-
- if (element.type === 'nostr' && element.bech32Id && element.nostrType) {
- // Render as embedded content
- if (element.nostrType === 'npub' || element.nostrType === 'nprofile') {
- return (
-
- )
- } else if (['nevent', 'naddr', 'note'].includes(element.nostrType)) {
- return (
-
- )
- }
- }
-
- // Fallback to text if something goes wrong
- return (
-
- {element.content}
-
- )
- })}
-
- )
-}
diff --git a/src/lib/notification.ts b/src/lib/notification.ts
deleted file mode 100644
index f261664a..00000000
--- a/src/lib/notification.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { kinds, NostrEvent } from 'nostr-tools'
-import { ExtendedKind } from '@/constants'
-import { hexPubkeysEqual } from '@/lib/pubkey'
-import { isMentioningMutedUsers } from './event'
-import { muteSetHas } from './mute-set'
-import { tagNameEquals } from './tag'
-
-export function notificationFilter(
- event: NostrEvent,
- {
- pubkey,
- mutePubkeySet,
- hideContentMentioningMutedUsers,
- hideUntrustedNotifications,
- isUserTrusted
- }: {
- pubkey?: string | null
- mutePubkeySet: Set