@using Microsoft.AspNetCore.WebUtilities
@inherits LayoutComponentBase
@inject NavigationManager nvgt
@using Todo_App.Data
@{
    void URL()
    {
        string yol = nvgt.ToBaseRelativePath(nvgt.Uri);
        if (yol.Substring(0, yol.Length) == "")
        {
            Login_info.email = null;
            Login_info.password = null;

            @Body
        }
        else if (yol == "normal_main")
        {
            if (Login_info.email != null && Login_info.password != null)
            {
                @Body
            }
            else
            {
                nvgt.NavigateTo("/");

            }
            System.Console.WriteLine("normal_kullanici");
        }
        else if (yol == "ekip_main")
        {
            if (Login_info.email != null && Login_info.password != null)
            {
                @Body
            }
            else
            {
                nvgt.NavigateTo("/");

            }
            System.Console.WriteLine("ekip_lideri");
        }
        else if (yol == "ekip_lideri")
        {
            if (Login_info.email != null && Login_info.password != null)
            {
                @Body
            }
            else
            {
                nvgt.NavigateTo("/");

            }
            System.Console.WriteLine("ekip_lideri");
        }
        else if (yol.Length > 8)
        {
            if (yol.Substring(0, 9) == "main_page")
            {
                if (Login_info.email != null && Login_info.password != null)
                {
                    <Todo_App.Pages.MainNavMenu></Todo_App.Pages.MainNavMenu>
                    @Body
                }
                else
                {
                    nvgt.NavigateTo("/");

                }

            }
            else
            {
                System.Console.WriteLine("1 " + yol.Length);
                <Todo_App.Pages.EmptyPage></Todo_App.Pages.EmptyPage>
                System.Console.WriteLine(yol);
            }
        }
        else
        {
            <Todo_App.Pages.EmptyPage></Todo_App.Pages.EmptyPage>
        }
    }
    URL();
}