{#if notif.eventType === "vote"} {@const url = notif.meta.url} {@const length = url.length} {@const shortUrl = url.slice(0, 10) + "..." + url.slice(length - 10, length)} {@const finalUrl = length > 24 ? shortUrl : url}

by {#if notif?.senders?.length > 1} {notif?.senders[0].handle} {#if notif.senders.length - 1 > 0} and {notif.senders.length - 1} more {/if} {:else} {notif.senders[0].handle.length > 12 ? notif.senders[0].handle.slice(0, 12) + "..." : notif.senders[0].handle} {/if}

extrenalNavigate(`https://yup-live.pages.dev/post/${notif.meta.postid}`)} aria-hidden class="text-blue-200 interactive-svg">{finalUrl}

{timeSince(new Date(notif.createdAt))}

{:else if notif.eventType === "reward"}
reward

You were alocated a future reward of {notif?.meta.quantity ?? "unknown"} amount of YUP.

{timeSince(new Date(notif.createdAt))}

{:else if ["follow"].includes(notif.eventType)}
{#each notif.senders as sender}
loader.onLoad()} on:error={() => loader.onError()} style={$mainStore.settings.theme === "light" ? "filter: invert(0.9);" : ""} slot="img" src={sender.avatar} alt="preview" />

extrenalNavigate(`https://yup-live.pages.dev/web3-profile/${sender?._id}`)} > {sender?.handle || `${sender?._id?.slice(0, 6)}...`} followed you.

{/each}

{timeSince(new Date(notif.createdAt))}

{:else}

{notif?.meta?.message ?? notif?.message ?? "unknown notification type"}

{timeSince(new Date(notif.createdAt))}

{/if}