@{
    ViewData["Title"] = Model.Tag.Name;
}

@model TagPageViewModel

<div id="banner-area">
    <img src="~/images/banner/banner2.jpg" alt="" />
    <div class="parallax-overlay"></div>
    <div class="banner-title-content">
        <div class="text-center">
            <h2><i class="fas fa-hashtag headerSwitch"></i>@Model.Tag.Name Tag</h2>
            <ul class="breadcrumb">
                <li>Home</li>
                <li><a asp-area="" asp-controller="Blog" asp-action="Index"> Blog</a></li>
                <li>
                    <a asp-area="" asp-controller="Tag" asp-action="Index" asp-route-id="@Model.Tag.Id">
                        @Model.Tag.Name
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>

<section id="main-container">
    <div class="container">
        <partial name="_TempDataPartial" />
        <div class="row">
            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                @foreach (var post in Model.Posts)
                {
                    @await Html.PartialAsync("_BlogPostPartial", post)
                }
                <div class="row" style="text-align: center">
                    @Html.PagedListPager((IPagedList)Model.Posts,
                            page => Url.Action("Index", "Tag",
                    new { page = page }),
                    PagedListRenderOptions.OnlyShowFivePagesAtATime)
                </div>
            </div>
            @await Component.InvokeAsync("Blog")
        </div>
    </div>
</section>