@using System.Security.Claims
@using Microsoft.AspNetCore.Identity
@* @using Microsoft.EntityFrameworkCore
@inject UserManager<IdentityApplicationUser> _userManager *@
@{bool hideToggle = ViewData["LayoutNavbarHideToggle"] != null && ViewData["LayoutNavbarHideToggle"].ToString() == "True";}

@* @{
    var user = _userManager.Users.Include(x => x.Company).FirstOrDefaultAsync(x => x.Id == _userManager.GetUserAsync(User).Result.Id).Result;
} *@

<!-- Layout navbar -->
<nav class="layout-navbar navbar navbar-expand-lg align-items-lg-center bg-white container-p-x" id="layout-navbar">

    <a href="/" class="navbar-brand app-brand demo d-lg-none py-0 mr-4">
        <span class="app-brand-logo demo bg-secondary">
            <i class="far fa-truck-loading text-white"></i>
        </span>
        <span class="app-brand-text demo font-weight-normal ml-2">EveryThing</span>
    </a>

    @if (!hideToggle)
    {
        <div class="layout-sidenav-toggle navbar-nav d-lg-none align-items-lg-center mr-auto">
            <a class="nav-item nav-link px-0 mr-lg-4" href="javascript:void(0)">
                <i class="ion ion-md-menu text-large align-middle"></i>
            </a>
        </div>
    }

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#layout-navbar-collapse">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="navbar-collapse collapse" id="layout-navbar-collapse">
        <hr class="d-lg-none w-100 my-2">

        <div class="navbar-nav align-items-lg-center">
            <div class="navbar-text col-lg-12 order-lg-1 w-auto w-lg-100 small px-0">
                @* <strong>@user.Company.Title</strong>, @user.Company.Street @user.Company.HouseNumber, @user.Company.PostNumber @user.Company.Post *@
            </div>
        </div>

        <div class="navbar-nav align-items-lg-center ml-auto">
            <a class="nav-item nav-link ml-lg-2" href="#">
                <i class="fas fa-cog navbar-icon align-middle"></i>
                <span class="d-lg-none align-middle">&nbsp; Nastavitve</span>
            </a>
            <a class="nav-item nav-link ml-lg-2" asp-page="/User/Logout">
                <i class="fas fa-sign-out-alt navbar-icon align-middle"></i>
                <span class=" align-middle">&nbsp; Odjava</span>
            </a>
        </div>
    </div>
</nav>