2023-06-15 21:53:24 -07:00
|
|
|
@page "/articles/latest"
|
2023-06-12 13:04:07 -07:00
|
|
|
@using Newsbot.Collector.Client
|
|
|
|
@using Newsbot.Collector.Client.Domain.Dto
|
2023-06-15 21:53:24 -07:00
|
|
|
|
|
|
|
<PageTitle>Latest</PageTitle>
|
|
|
|
<h3>Latest Posts</h3>
|
2023-06-12 13:04:07 -07:00
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
|
|
|
@foreach (var item in Data ??= new List<ArticlesDto>())
|
|
|
|
{
|
|
|
|
<div class="col-sm">
|
|
|
|
<div class="card" style="width: 18rem;">
|
|
|
|
<img src="@item.Thumbnail" class="card-img-top" alt="...">
|
|
|
|
<div class="card-body">
|
2023-06-15 21:53:24 -07:00
|
|
|
<h5 class="card-title">
|
|
|
|
<a href="@item.Url" target="_blank">@item.Title</a>
|
|
|
|
</h5>
|
|
|
|
<p class="card-text">@item.PubDate</p>
|
2023-06-12 13:04:07 -07:00
|
|
|
<p class="card-text">@item.Description</p>
|
|
|
|
<a href="@item.Url" class="btn btn-primary" target="_blank">View</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
List<ArticlesDto>? Data { get; set; }
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
{
|
|
|
|
var c = new ArticlesClient(Global.HttpClient, Global.DefaultInstanceUri ?? "");
|
|
|
|
var items = await c.ListArticlesAsync();
|
|
|
|
Data = items;
|
|
|
|
}
|
|
|
|
}
|