RBLNews/RBLNews.Shared/Components/Controls/BadgeWithCounter.razor
2024-09-19 15:14:28 +02:00

41 lines
981 B
Plaintext

@using RBLFeederCommon.Enums
<Button Size="ButtonSize.Small" Type="ButtonType.Button" @onclick="OnClicked" Color="ButtonColor.Primary" Outline="@outline" Position="Position.Relative">
@Text
<Badge Color="BadgeColor.Info"
Position="Position.Absolute"
Placement="BadgePlacement.TopRight"
IndicatorType="BadgeIndicatorType.RoundedPill"
VisuallyHiddenText="Anz. News">@Count</Badge>
</Button>
@code {
[Parameter]
public RssFeedSources Source { get; set; }
[Parameter]
public string Text { get; set; } = "";
[Parameter]
public bool ShowCount { get; set; }
[Parameter]
public int Count { get; set; }
[Parameter]
public EventCallback<RssFeedSources> OnClickedCallback { get; set; }
bool outline = true;
Task OnClicked()
{
outline = !outline;
OnClickedCallback.InvokeAsync(Source);
return Task.CompletedTask;
}
}