{#if isOwnProfile && $userStore.signedIn} Notifications
{#each modes as mode} {@const modeLabel = mode === "to-me" ? "To Me" : mode === "from-me" ? "From Me" : "Public Messages"} {/each}
{#if loading}
Loading {notificationMode === "public-messages" ? "public messages" : "notifications"}...
{:else if error}

Error loading {notificationMode === "public-messages" ? "public messages" : "notifications"}: {error}

{:else if notificationMode === "public-messages"} {#if publicMessages.length === 0}

No public messages found.

{:else}
{#if filteredByUser}

Filtered by user: @{authorProfiles.get(filteredByUser)?.displayName || authorProfiles.get(filteredByUser)?.name || "anon"}

{/if}
{#each filteredMessages.slice(0, 100) as message} {@const authorProfile = authorProfiles.get(message.pubkey)} {@const isFromUser = message.pubkey === $userStore.pubkey}
{#if authorProfile?.picture} {:else} {/if}
@{authorProfile?.displayName || authorProfile?.name || "anon"}
{#if !isFromUser}
{/if}
{isFromUser ? 'Your Message' : 'Public Message'} {message.created_at ? formatDate(message.created_at) : "Unknown date"}
{#if message.getMatchingTags("q").length > 0}
{@render quotedContent(message, publicMessages, ndk)}
{/if} {#if message.content}
{#if repostKinds.includes(message.kind)}
{message.kind === 6 ? 'Repost:' : 'Generic repost:'}
{@render repostContent(message.content)}
{:else if message.kind === 1 && message.getMatchingTags("q").length > 0}
Quote repost:
{@render quotedContent(message, publicMessages, ndk)} {#if message.content && message.content.trim()}
Comment:
{@render basicMarkup(message.content, ndk)}
{/if}
{:else} {@render basicMarkup(message.content || "No content", ndk)} {/if}
{/if}
{/each}
{#if totalPages > 1} {/if}
{/if} {:else} {#if notifications.length === 0}

No notifications {notificationMode === "to-me" ? "received" : "sent"} found.

{:else}
{#each notifications.slice(0, 100) as notification} {@const authorProfile = authorProfiles.get(notification.pubkey)}
{#if authorProfile?.picture} Author avatar {:else}
{/if}
@{authorProfile?.displayName || authorProfile?.name || "anon"}
{getNotificationType(notification)} {notification.created_at ? formatDate(notification.created_at) : "Unknown date"}
{#if notification.content}
{#if repostKinds.includes(notification.kind)}
{notification.kind === 6 ? 'Repost:' : 'Generic repost:'}
{@render repostContent(notification.content)}
{:else if notification.kind === 1 && notification.getMatchingTags("q").length > 0}
Quote repost:
{@render quotedContent(notification, notifications, ndk)} {#if notification.content && notification.content.trim()}
Comment:
{@render basicMarkup(notification.content, ndk)}
{/if}
{:else} {@render basicMarkup(notification.content || "No content", ndk)} {/if}
{/if}
{/each} {#if totalPages > 1} {/if}
{/if} {/if} {/if}