@page "/all"
@page "/archive"

@using FoodsharingSiegen.Contracts
@using FoodsharingSiegen.Contracts.Enums
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase

<PageTitle>Archiv - @AppSettings.Terms.Title</PageTitle>
<h2>Archiv</h2>

@if (AppSettings.TestMode)
{
    <div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
}

<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspectsAll" OnSortChanged="StateHasChanged" Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.All" />

@{
    var filterList = ProspectList.ApplyFilter(Filter);
    var sortList = filterList.ApplySort(CurrentSort);
}

<ProspectGrid
    Prospects="sortList"
    OnDataChanged="@LoadProspects"
    StateFilter="ProspectStateFilter.All">
</ProspectGrid>