63 lines
2.7 KiB
Plaintext
63 lines
2.7 KiB
Plaintext
@using System.Collections.Generic
|
|
@inject NavigationManager Navigation
|
|
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
@foreach (var item in Items)
|
|
{
|
|
<div class=@DashboardClass>
|
|
<div class="circle-tile">
|
|
<p>
|
|
<div class="circle-tile-heading @item.MainColor"><br />
|
|
<i class="@item.Icon"></i>
|
|
</div>
|
|
</p>
|
|
<div class="circle-tile-content @item.MainColor">
|
|
<div class="circle-tile-description text-faded" style="color: @item.ValueColor;">
|
|
<h5 style="text-transform: uppercase">@item.Title</h5>
|
|
@item.Description
|
|
</div>
|
|
<div class="circle-tile-number text-faded" style="color: @item.ValueColor;">
|
|
@item.Value
|
|
</div>
|
|
@* <!-- Utiliza el método NavigateToUrl para manejar la navegación -->
|
|
<a class="circle-tile-footer" @onclick="() => NavigateToUrl(item.Url)">More Info <i class="fa fa-chevron-circle-right"></i></a>
|
|
*@ <!-- RENDERIZAR FOOTER TIPO ONCLICK-->
|
|
@if (item.OnClickAction is not null)
|
|
{
|
|
<a class="circle-tile-footer" @onclick="async () => await item.OnClickAction(item.OnClickParam)">More Info <i class="fa fa-chevron-circle-right"></i></a>
|
|
}
|
|
else
|
|
{
|
|
<a class="circle-tile-footer" @onclick="() => NavigateToUrl(item.Url)">More Info <i class="fa fa-chevron-circle-right"></i></a>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public List<DashboardItem> Items { get; set; } = new List<DashboardItem>();
|
|
[Parameter]
|
|
public string DashboardClass { get; set; } = string.Empty;
|
|
|
|
private string cUrlAction = string.Empty;
|
|
|
|
public class DashboardItem
|
|
{
|
|
public string Title { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public string Value { get; set; } = string.Empty;
|
|
public string Icon { get; set; } = string.Empty;
|
|
public string MainColor { get; set; } = string.Empty;
|
|
public string ValueColor { get; set; } = string.Empty;
|
|
public string Url { get; set; } = string.Empty;
|
|
public Func<string?,Task>? OnClickAction { get; set; }
|
|
public string? OnClickParam { get; set; }
|
|
}
|
|
|
|
private void NavigateToUrl(string url) => Navigation.NavigateTo(url);
|
|
}
|