0} onclick={toggle} title="Notifications" data-testid="notification-bell" >
{#if unreadCount > 0}
{unreadCount > 99 ? '99+' : unreadCount}
{/if}
{#if open}
Notifications
{#if unreadCount > 0}
markAllRead()}>Mark all read
{/if} {#if history.length > 0}
{ clearHistory(); close(); }}>Clear
{/if}
{#if history.length === 0}
No notifications
{:else} {#each [...history].reverse() as item (item.id)}
handleClickNotification(item.id)} >
{typeIcon(item.type)}
{item.title}
{item.body}
{relativeTime(item.timestamp)}
{/each} {/if}
{/if}