using Microsoft.AspNetCore.Components;

namespace UI_MAUI.Components;

public partial class NavItem : ComponentBase
{
    [Parameter]
    public string Route { get; set; }

    [Parameter]
    public string Text { get; set; }

    [Parameter]
    public bool ShowIcon { get; set; } = false;

    [Parameter]
    public string IconFilename { get; set; } = string.Empty;

    [Inject]
    public NavigationManager NavigationManager { get; set; }

    private string AltText => $"Navigation: {this.Text}";

    private void Navigate() => this.NavigationManager.NavigateTo(this.Route);
}