Add sorting functionality for prospects with new ProspectSortControl component

This commit is contained in:
troogs
2026-04-16 21:42:15 +02:00
parent 701388ee34
commit eda6625e91
12 changed files with 153 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
@page "/done"
@using FoodsharingSiegen.Contracts
@using FoodsharingSiegen.Contracts.Enums
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
@@ -12,15 +13,18 @@
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
}
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspectsDone" OnSortChanged="StateHasChanged" />
@{
var filterList = ProspectList.ApplyFilter(Filter);
var sortList = filterList.ApplySort(CurrentSort);
}
<hr />
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.Completed"></ProspectFilterControl>
<hr />
<ProspectGrid
Prospects="filterList"
Prospects="sortList"
OnDataChanged="@LoadProspects"
StateFilter="ProspectStateFilter.Completed">
</ProspectGrid>