Thor/Thor.BlazorCommon/Components/CommentsView.razor
2025-09-03 04:25:16 +02:00

43 lines
891 B
Plaintext

<style>
.comment {
box-shadow: 5px 6px 6px 2px #e9ecef;
border-radius: 4px;
margin-top: 5px;
margin-bottom: 5px;
}
.author{
/*font-weight: bold;*/
font-style: italic;
}
</style>
<div >
@foreach (var c in Comments)
{
<div class="comment">
<span class="author">@(c.Author ?? "Inconnu")</span>:
<span>@c.Content</span>
</div>
}
<InputTextArea style="width:100%;" @bind-Value=@NewCommentText />
</div>
@code {
[Parameter]
public InspectionRegister Register { get; set; }
List<Comment> Comments { get; } = new();
string NewCommentText { get; set; } = "";
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
Comments.Add(new()
{
Content = "test comment"
});
}
}