<?php
  $appInternalName = config('app.internalName');
  $appConfig = config('constants.' . $appInternalName);
 ?>
<nav class="navbar navbar-light border-bottom py-0 border-bottom-primary-3px w-100 d-block">
    <div class="d-flex align-items-center px-3 mcp-theme-1 h-100">
        <a class="navbar-brand" href="{{route('index')}}">
            <img src="{{asset($appConfig['logo'])}}" style="max-width:150px;object-fit:contain;height:30px;" alt="">
        </a>
        <div class="d-none d-md-block flex-grow-1">
            <div class="bg-white d-flex flex-grow-1 align-items-center" id="mainNav">
                @if($performer && $performer->user && $performer->user->is_super_admin)
                    @include('app.my-account.nav.admin')
                @endif
                <div class="ms-auto">
                    <div class="d-flex align-items-center justify-content-md-end justify-content-center w-100">
                        <div>
                            <form action="{{ route('admin.users') }}" method="GET">
                                <input type="search" name="customer_name" placeholder="Search by name" class="form-control" value="{{ @$filters['customer_name'] }}" />
                            </form>
                        </div>
                        @if($performer && $performer->user)
                            <a class="text-dark d-block ms-3" href="{{ route('my-account.index') }}">
                                <h4 class="m-0"><i class="fal fa-user"></i></h4>
                            </a>
                            <a class="text-dark d-block ms-4" href="{{ route('log-out') }}">
                                <h4 class="m-0"><i class="fa-light fa-right-from-bracket fa-fw"></i></h4>
                            </a>
                        @else
                            <a class="text-dark d-block ms-3" href="{{ route('log-in') }}">
                                <h4 class="m-0"><i title="Sign In" class="fa-light fa-lock-alt fa-fw"></i></h4>
                            </a>
                        @endif
                    </div>
                </div>
            </div>
        </div>
        <div class="d-block d-md-none flex-grow-1"></div>
        <div class="d-block d-md-none ml-auto">
            <div class="on-hover-show d-inline-block position-relative ms-1">
                <span><button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button></span>
                <div class="on-hover-content pt-1">
                    @if($performer && $performer->user && $performer->user->is_super_admin)
                        @include('app.my-account.nav.admin-mobile')
                    @endif
                    <hr class="my-1">
                    @if($performer && $performer->user)
                        <a class="d-block text-nowrap py-1" href="{{ route('my-account.index') }}">My Account</a>
                        <a class="d-block text-nowrap py-1" href="{{ route('log-out') }}">Log Out</a>
                    @else
                        <a class="d-block text-nowrap py-1" href="{{ route('log-in') }}">Log In</a>
                    @endif
                </div>
            </div>
        </div>
    </div>
</nav>
