@using System.Text.RegularExpressions
@using System.ComponentModel.DataAnnotations
@using MarketData.MarketDataModel
@using eNavigator.Interfaces
@using eNavigator.Models
@using eNavigator.Routes
@using eNavigator.Components.Shared
@inject IMarketDataServiceClient marketDataServiceClient
@inject IStateContainer stateContainer
@inject ISnackbar snackbarService
@attribute [Route(PageRoute.Login)]

<div>
<div style="align-items: center; vertical-align: middle">
    <BusyIndicator IsBusy="@IsBusy" Message="@BusyMessage"></BusyIndicator>
</div>
<MudGrid>
    <MudItem xs="12" sm="7">
        <MudPaper Class="pa-4">
            <MudForm @ref="loginForm" >
                <MudTextField T="string" Immediate=true Label="Username" Disabled="@(isLoggedIn)" @bind-Text="User" align-center Required="true" RequiredError="User name is required!" />
                <MudTextField T="string" Immediate=true Label="Password" Disabled="@(isLoggedIn)" @bind-Text="Password"  Required="true"align-center InputType="InputType.Password" RequiredError="Password is required!"/>
                <div class="d-flex align-center justify-space-between">
                   <MudButton Variant="Variant.Filled" OnClick="LoginClicked" Color="Color.Primary" Disabled="@(!SubmitEnabled)" Class="ml-auto">Submit</MudButton>
                </div> 
                <MudTextField T="string" Label="Status" Disabled=true @bind-Text="Status" align-center />
            </MudForm>   
        </MudPaper>
    </MudItem>
</MudGrid>
</div>