@using RBLFeederCommon.Enums
@using RBLNews.Shared.Models

<Switch Class="mt-2" Value="this._filter" Label="@this.Text" ValueExpression="() => this._filter" ValueChanged="SwitchChanged" />


@code {

	private bool _filter = true;
	
	[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<FilterFeedEventArg> OnFilterChanged { get; set; }	
	
	Task SwitchChanged(bool value)
	{
		this._filter = value;
	
		OnFilterChanged.InvokeAsync(new FilterFeedEventArg
		{
			Source = this.Source,
			Value = value
		});
	
		return Task.CompletedTask;
	}

}