@page "/login"
@using System.IdentityModel.Tokens.Jwt;
@using System.Security.Claims;
@using Newtonsoft.Json.Linq;
@using System.Text.Json;
@using System.Reflection;
@using TIAMWebApp.Shared.Application.Interfaces;
@using TIAMWebApp.Shared.Application.Models.PageModels;
@using TIAMSharedUI.Pages.Components;
@using TIAMWebApp.Shared.Application.Models.ClientSide;
@using TIAMWebApp.Shared.Application.Models;
@using TIAMWebApp.Shared.Application.Utility;
@using AyCode.Interfaces.StorageHandlers;


<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">
        @localizer["LoginTitleText"]
    </div>
    <form class="p-3 mt-3">
        <div>
            @switch (currentStep)
            {
                case 1:
                    <LoginStep1 @bind-LoginModel="loginModel" onLoginNext="GoToNextStep" />
                    ;
                    break;

                case 2:
                    <LoginStep3 @bind-LoginModel="loginModel" onSubmit="SubmitLogin" onPrev="GoToPreviousStep" />
                    ;
                    break;
            }
        </div>


    </form>
    <p>@currentStep</p>
    @{
        if (!loggedIn)
        {

            <div>

                <p>@localizer["LoginEmail"]: @loginModel.Email</p>

                <p>@loginModel.Password</p>
            </div>
        }
    }
    <div class="text-center fs-6">
        No account yet? <a href="register">Sign up here!</a>
    </div>
</div>

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

    
}