@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as
//     published by the Free Software Foundation, either version 3 of the
//     License, or (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
//
//     You should have received a copy of the GNU General Public License
//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@inject StringLocalizer<NavMenu> L

<div class="top-row pl-4 navbar navbar-dark">
    <a class="navbar-brand" href="">Marechai</a>
    <button class="navbar-toggler" @onclick="ToggleNavMenu">
        <span class="navbar-toggler-icon"></span>
    </button>
</div>

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
    <ul class="nav flex-column">
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="fa fa-newspaper" aria-hidden="true"></span>&nbsp;@L["News"]
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="companies">
                <span class="fa fa-building" aria-hidden="true"></span>&nbsp;@L["Companies"]
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="computers">
                <span class="fa fa-desktop" aria-hidden="true"></span>&nbsp;@L["Computers"]
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="consoles">
                <span class="fa fa-gamepad" aria-hidden="true"></span>&nbsp;@L["Consoles"]
            </NavLink>
        </li>
        <AuthorizeView Roles="UberAdmin, Admin">
            <li class="nav-item px-3">
                <NavLink class="nav-link" href="admin">
                    <span class="fa fa-tools" aria-hidden="true"></span>&nbsp;@L["Admin area"]
                </NavLink>
            </li>
        </AuthorizeView>
    </ul>
</div>

@code {
    private bool _collapseNavMenu = true;

    private string NavMenuCssClass => _collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        _collapseNavMenu = !_collapseNavMenu;
    }

}