2025-01-24 19:17:26 -03:00
|
|
|
@using System.Collections.Generic
|
|
|
|
|
@inject NavigationManager Navigation
|
|
|
|
|
|
|
|
|
|
<div class="panel-body">
|
2025-04-21 19:41:26 -03:00
|
|
|
@* <div class="row">
|
2025-01-24 19:17:26 -03:00
|
|
|
@foreach (var item in Items)
|
|
|
|
|
{
|
|
|
|
|
<div class=@DashboardClass>
|
|
|
|
|
<div class="circle-tile">
|
|
|
|
|
<p>
|
2025-04-21 19:41:26 -03:00
|
|
|
<div class="circle-tile-heading @item.MainColor">
|
|
|
|
|
<br />
|
2025-01-24 19:17:26 -03:00
|
|
|
<i class="@item.Icon"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</p>
|
|
|
|
|
<div class="circle-tile-content @item.MainColor">
|
2025-04-21 19:41:26 -03:00
|
|
|
<div class="circle-tile-description text-faded" style="color: @item.ValueColor;">
|
2025-01-24 19:17:26 -03:00
|
|
|
<h5 style="text-transform: uppercase">@item.Title</h5>
|
|
|
|
|
@item.Description
|
|
|
|
|
</div>
|
2025-04-21 19:41:26 -03:00
|
|
|
<div class="circle-tile-number text-faded" style="color: @item.ValueColor;">
|
2025-01-24 19:17:26 -03:00
|
|
|
@item.Value
|
|
|
|
|
</div>
|
|
|
|
|
@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>
|
2025-04-21 19:41:26 -03:00
|
|
|
*@
|
|
|
|
|
<!-- MAPA DE EJEMPLO -->
|
|
|
|
|
<div class="row mt-4">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="card shadow rounded-3">
|
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
|
<strong>Ubicación de ejemplo</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<PhMap Latitude="-34.618998"
|
|
|
|
|
Longitude="-58.501015" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-01-24 19:17:26 -03:00
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[Parameter] public List<DashboardItem> Items { get; set; } = new List<DashboardItem>();
|
2025-04-21 19:41:26 -03:00
|
|
|
[Parameter] public string DashboardClass { get; set; } = string.Empty;
|
2025-01-24 19:17:26 -03:00
|
|
|
|
|
|
|
|
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;
|
2025-04-21 19:41:26 -03:00
|
|
|
public Func<string?, Task>? OnClickAction { get; set; }
|
2025-01-24 19:17:26 -03:00
|
|
|
public string? OnClickParam { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NavigateToUrl(string url) => Navigation.NavigateTo(url);
|
2025-04-21 19:41:26 -03:00
|
|
|
|
|
|
|
|
private void OnMapChanged((double Lat, double Lng) loc)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"Nueva ubicación desde el mapa: {loc.Lat}, {loc.Lng}");
|
|
|
|
|
// Aquí podrías guardar en una variable, mostrar en UI, o integrarlo con lógica posterior
|
|
|
|
|
}
|
2025-01-24 19:17:26 -03:00
|
|
|
}
|