2024-06-13 04:46:24 +00:00
|
|
|
@inject IJSRuntime JS
|
|
|
|
@inject State State
|
|
|
|
|
2024-06-13 10:02:51 +00:00
|
|
|
@if (Editable) {
|
|
|
|
<EditStatusDialog @ref="Dialog" id="EditStatusModal"></EditStatusDialog>
|
|
|
|
}
|
|
|
|
|
2024-06-13 04:46:24 +00:00
|
|
|
@if(statuses != null) foreach(Status status in statuses) {
|
2024-06-13 10:02:51 +00:00
|
|
|
<StatusCard Status="@status" Editable="Editable" Dialog="Dialog"></StatusCard>
|
2024-06-13 04:46:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<LoadingCard id="statusLoading" icon="fa-solid fa-message-smile"></LoadingCard>
|
2024-06-05 12:41:08 +00:00
|
|
|
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
2024-06-13 04:46:24 +00:00
|
|
|
public Func<Task<List<Status>?>> StatusFunc { get; set; }
|
|
|
|
[Parameter]
|
|
|
|
public bool Editable { get; set; } = false;
|
2024-06-13 10:02:51 +00:00
|
|
|
|
|
|
|
public EditStatusDialog? Dialog { get; set; }
|
2024-06-13 04:46:24 +00:00
|
|
|
|
|
|
|
private List<Status>? statuses;
|
2024-06-13 00:26:43 +00:00
|
|
|
|
2024-06-13 04:46:24 +00:00
|
|
|
protected override async Task OnInitializedAsync() {
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
if (statuses == null || statuses.Count == 0) statuses = await StatusFunc();
|
|
|
|
await InvokeAsync(StateHasChanged);
|
|
|
|
await JS.InvokeVoidAsync("removeElementById", "statusLoading");
|
2024-06-13 00:26:43 +00:00
|
|
|
}
|
2024-06-05 12:41:08 +00:00
|
|
|
}
|