56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using MP.Data.DatabaseModels;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.Stats.Components
|
|
{
|
|
public partial class TLResult
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public TaskListModel CurrRecord { get; set; } = null!;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
protected string alCss
|
|
{
|
|
get => CurrRecord.LastIsError ? "alert-danger" : "alert-success";
|
|
}
|
|
|
|
protected string btnCss
|
|
{
|
|
get
|
|
{
|
|
string answ = showDetail ? "btn-" : "btn-outline-";
|
|
answ += CurrRecord.LastIsError ? "danger" : "success";
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
protected string iconCss
|
|
{
|
|
get => CurrRecord.LastIsError ? "fa-thumbs-down" : "fa-thumbs-up";
|
|
}
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected async Task toggleDetail()
|
|
{
|
|
showDetail = !showDetail;
|
|
await InvokeAsync(StateHasChanged);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Properties
|
|
|
|
private bool showDetail { get; set; } = false;
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |