@page "/pokemon-sleep/edit-pokemon/{id:int}"
@inject IPokemonService PokemonService
@inject NavigationManager Navigation
@inject IJSRuntime JS

@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Edit Pokémon</PageTitle>
<PokemonNavMenu />


@if (pokemon == null)
{
    <Loading />
}
else
{

    <div class="container mt-5 w-50 mb-5">
        <div class="row d-flex flex-row mb-0 justify-content-center">
            <div class="w-50">
                <div class="editcard">
                        <PokemonForm 
                            formUse="EDIT"
                            OnPokemonReady="ReceivePokemon"
                            RemoveForm="Cancel"
                            mostRecentForm=true
                            PokemonToEdit="pokemon"
                        />
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex justify-content-center">
        <div class="btn-group">
            <button @onclick="@HandleSubmit" class="btn btn-primary rounded">Edit Pokemon</button>
        </div>
    </div>

}
