SharpRSS/WebSharpRSS/Pages/Index.razor

38 lines
900 B
Plaintext
Raw Normal View History

2023-04-27 17:23:01 +02:00
@page "/"
2023-05-26 21:54:12 +02:00
@page "/dashboard"
2023-05-17 16:03:04 +02:00
@using WebSharpRSS.Models;
@using SharpRss.Models
@using SharpRss.Services
2023-04-27 17:23:01 +02:00
2023-05-17 16:03:04 +02:00
@inject FeedStateContainer _stateContainer;
@inject SyndicationService _service;
<MudGrid Spacing="2" Class="mx-2" Justify="Justify.FlexStart">
@if (_loading)
{
<MudProgressCircular Indeterminate="true" Color="Color.Primary"/>
}
else
{
@foreach (CategoryModel category in _categories)
{
<MudItem>
<DashboardCategoryItemView Category="category"/>
</MudItem>
}
}
2023-05-26 21:54:12 +02:00
</MudGrid>
2023-04-27 17:23:01 +02:00
@code {
bool _loading = true;
HashSet<CategoryModel> _categories = new HashSet<CategoryModel>();
protected override async void OnInitialized()
{
await _service.GetCategoriesAsync().ContinueWith(task =>
{
_categories = task.Result;
_loading = false;
});
}
2023-04-27 17:23:01 +02:00
}