@page "/counter"
@page "/counter/{CurrentCount:int}"
@inject NavigationManager navManager;

@layout MainLayout2

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @CurrentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

<a class="btn btn-primary" href="FetchData">Fetch data</a>

<button class=" btn btn-primary" @onclick="NavitateToFetchData">Fetch data2</button>

@code {
    private void IncrementCount()
    {
        CurrentCount++;
    }

    private void NavitateToFetchData()
    {
        navManager.NavigateTo("FetchData");
    }

    [Parameter]
    public int CurrentCount { get; set; }
}
