40 lines
720 B
Plaintext
40 lines
720 B
Plaintext
@page "/links/{id:guid}"
|
|
@inject LinksClient Links
|
|
|
|
|
|
@if(_item == null)
|
|
{
|
|
<Title Value="Affichage du lien ..." />
|
|
<p>Chargement du lien en cours ...</p>
|
|
}
|
|
else
|
|
{
|
|
<Title Value=@($"Affichage du lien {_item.Url}") />
|
|
<LinkItem Item="@_item" />
|
|
|
|
@if(_comments == null)
|
|
{
|
|
<p>Commentaires en cours de chargement ...</p>
|
|
}
|
|
else
|
|
{
|
|
foreach (var comment in _comments)
|
|
{
|
|
<p>@comment.Content</p>
|
|
}
|
|
}
|
|
}
|
|
|
|
@code {
|
|
[Parameter]
|
|
public Guid Id { get; set; }
|
|
|
|
private LinkDto _item;
|
|
private ICollection<CommentDto> _comments;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
_item = await Links.GetLinkByIdAsync(Id);
|
|
_comments = await Links.GetLinkCommentsAsync(Id);
|
|
}
|
|
} |