@page "/addPlayer"
@using Blazor.Models
@using Blazor.Components

<BackButton RedirectionPage="/players"></BackButton>
<PageTitle>@Localizer["PageTitle"]</PageTitle>  
<div class="container text-center">
    <div class="border border-dark p-4 d-inline-block">
        <h3>@Localizer["Title"]</h3>

        <EditForm Model="@playerModel" OnValidSubmit="@HandleValidSubmit">
            <DataAnnotationsValidator />
            <ValidationSummary />

            <div class="row mb-3">
                <div class="col-5 text-end">
                    <label for="nickname" class="col-form-label">@Localizer["Nickname"] :</label>
                </div>
                <div class="col-7">
                    <InputText id="nickname" @bind-Value="playerModel.Nickname" class="form-control"/>
                </div>
            </div>
            <div class="row mb-3">
                <div class="col-5 text-end">
                    <label for="hashedPassword" class="col-form-label">@Localizer["HashedPassword"] :</label>
                </div>
                <div class="col-7">
                    <InputText id="hashedPassword" @bind-Value="playerModel.HashedPassword" class="form-control" type="password" />
                </div>
            </div>


            <button type="submit" class="btn btn-success">@Localizer["Submit"]</button>
        </EditForm>
    </div>
</div>