@using System.Drawing @using Fluxor @using Start.Client.Store.State @using Start.Client.Store.Features.DeleteGroup @using Start.Client.Store.Features.CreateBookmark @inherits Fluxor.Blazor.Web.Components.FluxorComponent @inject IState state @inject IDispatcher dispatch

@this.Group.Title

@if (this.state.Value.EditMode) { }
    @if (this.Group.Bookmarks == null || !this.Group.Bookmarks.Any()) {
  • No Bookmarks

  • } else { foreach (BookmarkDto bookmark in this.Group.Bookmarks) { } @if (this.state.Value.EditMode) {
  • } }
@code { [Parameter] public BookmarkGroupDto Group { get; set; } = null!; protected string ForegroundTitleColorClass { get { const int threshold = 105; Color bgColor = ColorTranslator.FromHtml(this.Group.Color); double val = Math.Floor((bgColor.R * .299) + (bgColor.G * 0.587) + (bgColor.B * 0.114)); if ((255 - val) < threshold) return "text-dark"; return "text-light"; } } protected void OnDeleteGroupClicked() { dispatch.Dispatch(new ShowDeleteGroupFormAction( this.Group.BookmarkGroupId, this.Group.Title)); } protected void OnCreateBookmarkClicked() { dispatch.Dispatch(new ShowCreateBookmarkFormAction(this.Group.BookmarkGroupId, this.Group.Title)); } }