@using Admin.Pages.Shared.Layout
@inject ILayoutDataProvider LayoutDataProvider
@{
	var layoutViewModel = await LayoutDataProvider.CreateAsync(Context);
}
<!DOCTYPE html>
<html lang="ko">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>@ViewData["Title"] - Admin</title>

	<meta name="description" content="bitforum.io 관리자 페이지입니다." />
	<meta name="author" content="https://playr.co.kr" />
	<meta name="copyright" content="playr" />
	<meta name="referrer" content="no-referrer">

	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Content-Language" content="ko" />
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />

	<meta name="robots" content="noindex, nofollow" />

	<script type="importmap"></script>
	<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
	<link rel="stylesheet" href="~/lib/bootstrap-icons/font/bootstrap-icons.min.css" />
	<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
	<link rel="stylesheet" href="~/css/admin.css" asp-append-version="true" />

	@await RenderSectionAsync("Styles", required: false)
</head>
<body>
	<aside id="aside">
		<ul class="nav flex-column">
			@if (layoutViewModel is not null)
			{
				foreach (var menu in layoutViewModel.Menus)
				{
					<partial name="_MenuItem" model="menu" />
				}
			}
		</ul>
		<footer>ⓒ <a href="https://playr.co.kr" target="_blank" rel="external">PLAYR</a>. All Rights Reserved</footer>
	</aside>

	<main id="main">
		<header id="header">
			<div class="row justify-content-between align-items-center g-0">
				<div class="col">
					<button type="button" id="btnAsideToggle" class="btn btn-light">
						<i class="bi bi-arrow-left"></i>
					</button>
				</div>
				<div class="col text-center">
					<a href="/" ref="home" target="_self" class="logo">
						<strong>
							<img src="/images/favicon.ico" /> @(layoutViewModel?.AppSettings?.App.Name ?? string.Empty)
						</strong>
					</a>
				</div>
				<div class="col text-end">
					<div class="dropdown profile">
						<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
							<span class="profile-text">@layoutViewModel?.UserName</span>
							<i class="bi bi-person-fill profile-icon"></i>
						</button>
						<ul class="dropdown-menu">
							<li><a href="/Identity/Account/Manage" class="dropdown-item">내 정보</a></li>
							<li>
								<form asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="~/" method="post">
									<button type="submit" class="dropdown-item">로그아웃</button>
								</form>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</header>

		<div class="pt-4">
			@RenderBody()
		</div>
	</main>

	<script src="~/lib/jquery/dist/jquery.min.js"></script>
	@await Html.PartialAsync("_ValidationScriptsPartial")
	<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
	<script src="~/js/func.js" asp-append-version="true"></script>
	<script src="~/js/site.js" asp-append-version="true"></script>

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