@page "/login_old"
@using TIAMWebApp.Shared.Application.Interfaces;
@using TIAMWebApp.Shared.Application.Models;
@using TIAMWebApp.Shared.Application.Models.PageModels;
@inject NavigationManager navManager
@inject IUserDataService userDataService
<PageTitle>Login</PageTitle>

<div class="wrapper">
        <div class="my-logo">
            <img src="_content/TIAMSharedUI/images/png-logo-0.png" alt="">
        </div>
        <div class="text-center mt-4 name">
            Tour I Am
        </div>
        <EditForm Model="@loginModel" OnValidSubmit="Submit">
            <DataAnnotationsValidator />
            <!--ValidationSummary /-->
        <div class="p-3 mt-3">
            <div class="form-field d-flex align-items-center">
                <span class="far fa-user"></span>
                <input type="email" @bind-value="loginModel.Email" name="email" id="phoneNumber" placeholder="Phone number">
                <ValidationMessage For="@(() => loginModel.Email)" />
            </div>
            <div class="form-field d-flex align-items-center">
                <span class="fas fa-key"></span>
                <input type="password" @bind-value="loginModel.Password" name="password" id="pwd" placeholder="Password">
                <ValidationMessage For="@(() => loginModel.Password)" />
            </div>
            <div class="form-field d-flex align-items-center">

            <select style="width:100%" @bind="CurrentValue" class="custom-select" title="Destination is required ">
                    <option value="0" selected disabled="disabled">(Choose account type)</option>
                    <option value="1" selected>Hotel</option>
                    <option value="2" selected>Transfer</option>
                    <option value="3" selected>Guide</option>
                    <option value="4" selected>Admin</option>
                    <option value="5" selected>UserModel</option>                  
                    <option value="6" selected>Driver</option>                  
                </select>
            </div>
        <!--button class="btn btn-primary mt-3" @onclick="next">Login</button-->
        <!--a class="btn btn-primary mt-3" @onclick="next">Login</a-->
        <button class="btn btn-primary mt-3" type="submit">Login</button>
        </div>
        </EditForm>
        <p>@isUserLoggedIn</p><p>@CurrentValue</p>
        <div class="text-center fs-6">
            <a href="#">Forget password?</a> or <a href="register">Sign up</a>
        </div>
    </div>

@code {
    LoginModel loginModel = new LoginModel("", "");

    bool isUserLoggedIn;
    int CurrentValue = 0;

    public async Task next()
    {
        //var user = await userDataService.IsLoggedInAsync();
        //user.IsLoggedIn = true;
        //isUserLoggedIn = user.IsLoggedIn;
        //user.UserType = (UserType)CurrentValue;
        //navManager.NavigateTo("home");

    }

    public void Submit()
    {
        
    }
}
