@section('sidebar')
    <aside id="sidebar-wrapper">
        <div class="sidebar-brand">
            <a href="/">KONASPI XI 2024</a>
        </div>
        <div class="sidebar-brand sidebar-brand-sm" >
            <a href="/">KONASPI XI 2024</a>
        </div>
        <br>
        <ul class="sidebar-menu" id="mySidebar">
                @if (auth()->user() != null)
                    <li class="nav-item">
                        <a class="nav-link" href=""><i class="fas fa-home"></i><span>Home</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('admin.index_peserta')}}"><i class="fa fa-users"></i><span>Data Peserta</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('admin.index_kegiatan')}}"><i class="fa fa-suitcase"></i><span>Master Kegiatan</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('admin.index_konferensi')}}"><i class="fa fa-user-circle"></i><span>Master Konferensi</span></a>
                    </li>
                @else
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('pre-register')}}"><i class="fas fa-file-pen"></i><span>Registrasi</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{url('/login')}}"><i class="fa fa-sign-in"></i><span>Login</span></a>
                    </li>
                @endif
        </ul>
    </aside>
    <script>
     // Get the container element
var btnContainer = document.getElementById("mySidebar");

// Get all buttons with class="btn" inside the container
var btns = btnContainer.getElementsByClassName("nav-item");

// Loop through the buttons and add the active class to the current/clicked button
for (var i = 0; i < btns.length; i++) {
    btns[i].addEventListener("click", function() {
    var current = document.getElementsByClassName("active");
    current[0].className = current[0].className.replace(" active", "");
    this.className += " active";
  });
}
    </script>
@show
