@using Microsoft.AspNetCore.Identity
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using ReviewApp.Models

@inject SignInManager<User> SignInManager

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Обзоры товаров</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/ReviewApp.styles.css" asp-append-version="true" />
</head>
<body>
    <header class="right-aligned header">
    <a asp-controller="Home" asp-action="Index" class="margin-header" title="Главная">Главная</a>
    @if (SignInManager.IsSignedIn(User))
    {
        <span class="margin-header centrally-aligned">Добро пожаловать @User.Identity.Name!</span>
        <a asp-controller="Account" asp-action="LogOut" class="margin-header" title="Выйти">Выйти</a>
    }
    else
    {
        <a asp-controller="Account" asp-action="Login" class="margin-header" title="Войти">Войти</a>
        <a asp-controller="Account" asp-action="Register" class="margin-header" title="Зарегистрироваться">Зарегистрироваться</a>
    }
    </header>

    <div>
        @RenderBody()
    </div>

    <!-- Footer -->
    <div class="centrally-aligned signature">Николай Калуджерович</div>

    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>

    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>
