<nav class="navbar navbar-expand-lg bg-body-tertiary">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">
            <img src="/img/logo.png" alt="Kynsight" width="40" height="40">
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                {% for item in theme.menu.navbar_items %}
                    {% if item.global %}
                        {% if item.sublinks %}
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                    {{item.text}}
                                </a>
                                <ul class="dropdown-menu">
                                    {% for sublink in item.sublinks %}
                                        <a class='dropdown-item' href="{{ url_for(sublink.url) }}">{{sublink.text}}</a>
                                    {% endfor %}
                                </ul>
                            </li>
                        {% elif item.url %}
                            <li class="nav-item">
                                <a class="nav-link" href="{{ url_for(item.url) }}">{{item.text}}</a>
                            </li>
                        {% endif %}
                    {% endif %}
                {% endfor %}
            </ul>
            <form class="d-flex" role="search">
                <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-outline-success" type="submit">Search</button>
            </form>
            <ul class="navbar-nav">
                {% for item in theme.menu.navbar_items %}
                    {% if item.user %}
                        {% if item.sublinks %}
                        {% elif item.url %}
                            <li class="nav-item">
                                <a class="nav-link" href="{{ url_for(item.url) }}">{{item.text}}</a>
                            </li>
                        {% endif %}
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
    </div>
</nav>
