@using FoodsharingSiegen.Contracts.Model
@inherits FsBase
@code {

  [Parameter]
  public ProspectFilter Filter { get; set; } = new();
  
  [Parameter]
  public EventCallback<ProspectFilter> FilterChanged { get; set; }


  private async Task WithoutStepInBriefingChangedAsync(bool arg)
  {
    Filter.WithoutStepInBriefing = arg;
    await FilterChanged.InvokeAsync(Filter);
  }

  private async Task TextChanged(string arg)
  {
    Filter.Text = arg;
    await FilterChanged.InvokeAsync(Filter);
  }

}

<div class="card">
  <div class="card-header" style="padding: .5rem;">
    <i class="fa-solid fa-filter"></i> Suchfilter
  </div>
  <div class="card-body" style="padding: .5rem;">
    <div style="margin-left: 1rem;">
      <Switch TValue="bool" Checked="Filter.WithoutStepInBriefing" CheckedChanged="WithoutStepInBriefingChangedAsync">Ohne @AppSettings.StepInName</Switch>
    </div>
    <TextEdit Text="@Filter.Text" TextChanged="TextChanged" Placeholder="Suchen..." Debounce="true" DebounceInterval="150"/>
  </div>
</div>