
<div id="layoutSidenav_nav">
    <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
        <div class="sb-sidenav-menu">
            <div class="nav">
                @if(auth()->user()->role=='Super Admin' || auth()->user()->role=='Admin')
                <div class="sb-sidenav-menu-heading">Core</div>
                <a class="nav-link {{ (request()->routeIs('dashboard')) ? 'active' : '' }}" href="{{ route('dashboard') }}" wire:navigate>
                    <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                    Dashboard
                </a>
                @endif
                @if(auth()->user()->role=='Super Admin' || auth()->user()->role=='Admin')
                <div class="sb-sidenav-menu-heading">Admin</div>
                <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#collapseLayouts" aria-expanded="false" aria-controls="collapseLayouts">
                    <div class="sb-nav-link-icon"><i class="fa-solid fa-users"></i></div>
                    User Management
                    <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                </a>
                <div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
                    <nav class="sb-sidenav-menu-nested nav">
                        <a class="nav-link {{ (request()->routeIs('user')) ? 'active' : '' }}" href="{{ route('user') }}" wire:navigate>User List</a>
                        <!-- <a class="nav-link" href="layout-sidenav-light.html">Light Sidenav</a> -->
                    </nav>
                </div>
                <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#collapseFormBuilder" aria-expanded="false" aria-controls="collapseFormBuilder">
                    <div class="sb-nav-link-icon"><i class="fa-brands fa-wpforms"></i></div>
                    Form Builder
                    <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                </a>
                <div class="collapse" id="collapseFormBuilder" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
                    <nav class="sb-sidenav-menu-nested nav">
                        <a class="nav-link {{ (request()->routeIs('form-builder')) ? 'active' : '' }}" href="{{ route('form-builder') }}" wire:navigate>Form List</a>
                        <a class="nav-link {{ (request()->routeIs('formContent')) ? 'active' : '' }}" href="{{ route('formContent') }}" wire:navigate>Form Content</a>
                    </nav>
                </div>
                <a class="nav-link {{ (request()->routeIs('chart-builder')) ? 'active' : '' }}" href="{{ route('chart-builder') }}"  wire:navigate>
                    <div class="sb-nav-link-icon"><i class="fa-brands fa-wpforms"></i></div>
                    Chart Builder
                </a>
                @endif
                <!-- <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#collapsePages" aria-expanded="false" aria-controls="collapsePages">
                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                    Pages
                    <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                </a>
                <div class="collapse" id="collapsePages" aria-labelledby="headingTwo" data-bs-parent="#sidenavAccordion">
                    <nav class="sb-sidenav-menu-nested nav accordion" id="sidenavAccordionPages">
                        <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#pagesCollapseAuth" aria-expanded="false" aria-controls="pagesCollapseAuth">
                            Authentication
                            <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                        </a>
                        <div class="collapse" id="pagesCollapseAuth" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordionPages">
                            <nav class="sb-sidenav-menu-nested nav">
                                <a class="nav-link" href="login.html">Login</a>
                                <a class="nav-link" href="register.html">Register</a>
                                <a class="nav-link" href="password.html">Forgot Password</a>
                            </nav>
                        </div>
                    </nav>
                </div> -->
                @if(auth()->user()->role=='Super Admin' || auth()->user()->role=='User')
                <div class="sb-sidenav-menu-heading">Interface</div>
                <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#pagesCollapseError" aria-expanded="false" aria-controls="pagesCollapseError">
                    <div class="sb-nav-link-icon"><i class="fa-solid fa-file-pen"></i></div>
                    Data Entry
                    <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                </a>
                <div class="collapse" id="pagesCollapseError" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordionPages">
                    <nav class="sb-sidenav-menu-nested nav">
                        @foreach($tableMenu as $table)
                        <a class="nav-link" href="{{ route('dataEnter',$table->id) }}" wire:navigate>{{$table->name}}</a>
                        @endforeach
                    </nav>
                </div>
                @endif
                <!-- <a class="nav-link" href="tables.html">
                    <div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
                    Tables
                </a> -->
            </div>
        </div>
        <div class="sb-sidenav-footer">
            <div class="small">Logged in as:</div>
            {{auth()->user()->role}}
        </div>
    </nav>
</div>