<header>
    <nav class="brown lighten-2">
        <div class="nav-wrapper">
            <a href="/" class="brand-logo">
                <img src="/img/kaellyProfile.png" class="circle navbar-img" alt="">
                KaellyBot
            </a>
            <a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
            <ul id="nav-mobile" class="right hide-on-med-and-down">
            
                <% if (locals.user){ %>
                    <li><a class="dropdown-trigger" href="#!" data-target="user">
                        <img class="circle navbar-img" src="<%= `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png` %>">
                        <%= user.username %>
                        <i class="material-icons right">arrow_drop_down</i>
                    </a></li>
                <% } else { %>
                    <li><a href="/login">Login<i class="material-icons left white-text">account_circle</i></a></li>
                <% } %>
            </ul>
            <% if (locals.user){ %>
                <ul id="user" class="dropdown-content">
                    <li><a class="grey-text text-darken-3" href="/dashboard">
                        Dashboard
                        <i class="material-icons brown-text text-lighten-1">dashboard</i>
                    </a></li>
                    <li><a class="grey-text text-darken-3" href="/logout">
                        Logout
                        <i class="material-icons brown-text text-lighten-1">exit_to_app</i>
                    </a></li>
                </ul>
            <% } %>
        </div>
        <ul class="sidenav" id="mobile-demo">
            <% if (locals.user){ %>
            <li>
                <div class="user-view">
                    <div class="background brown lighten-2">
                    </div>
                    <a href="#user">
                        <img class="circle" src="<%= `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png` %>">
                    </a>
                    <a href="#name"><span class="white-text name"><%= user.username %></span></a>
                </div>
            </li>
            <li><a class="grey-text text-darken-3" href="/dashboard">
                Dashboard
                <i class="material-icons brown-text text-lighten-1">dashboard</i>
            </a></li>
            <li><a class="grey-text text-darken-3" href="/logout">
                Logout
                <i class="material-icons brown-text text-lighten-1">exit_to_app</i>
            </a></li>
            <% } else { %>
                <li><a class="grey-text text-darken-3" href="/login">
                    Login
                    <i class="material-icons brown-text text-lighten-1">account_circle</i>
                </a></li>
            <% } %>
        </ul>
    </nav>
</header>