app/BTCPayApp.UI/Components/NotificationsBell.razor

18 lines
592 B
Plaintext

@inject IState<StoreState> StoreState
@using BTCPayApp.UI.Features
@inherits Fluxor.Blazor.Web.Components.FluxorComponent
<a class="btn btn-light rounded-circle" href="@Routes.Notifications">
<Icon Symbol="nav-notifications"/>
@if (UnreadNotificationsCount.GetValueOrDefault() > 0)
{
<span class="badge rounded-pill bg-danger p-1" id="notifications-badge">@UnreadNotificationsCount</span>
}
<span class="visually-hidden">Notifications</span>
</a>
@code {
private int? UnreadNotificationsCount => StoreState.Value.Notifications?.Data?.Count(n => !n.Seen);
}