@{
    ViewData["Title"] = "Followers";
}

@model FollowersPaginationViewModel

<div class="tab-pane fade in active">
    @foreach (var follower in Model.Followers)
    {
        <div class="media user-follower">
            <img src=@follower.ImageUrl alt="User Avatar" class="media-object pull-left">
            <div class="media-body">
                <a asp-area="" asp-controller="Profile" asp-action="Index" asp-route-username="@follower.Username">@follower.Username<br><span class="text-muted username">@follower.FirstName  @follower.LastName</span></a>
                @if (User.Identity.Name == follower.Username)
                {
                    <a asp-area="" asp-controller="Profile" asp-action="Index" asp-route-username="@follower.Username" type="button" class="btn btn-sm btn-info pull-right">
                        <i class="fas fa-check-circle"></i> <span>It's You</span>
                    </a>
                }
                else
                {
                    @if (follower.HasFollow)
                    {
                        <form asp-controller="Profile" asp-action="Unfollow" asp-route-username="@follower.Username" method="post">
                            <button type="submit" class="btn btn-sm btn-danger pull-right">
                                <i class="fas fa-minus-circle"></i> <span>Unfollow</span>
                            </button>
                        </form>
                    }
                    else
                    {
                        <form asp-area="" asp-controller="Profile" asp-action="Follow" asp-route-username="@follower.Username" method="post">
                            <button type="submit" class="btn btn-sm btn-success pull-right">
                                <i class="fas fa-plus-circle"></i> <span>Follow</span>
                            </button>
                        </form>
                    }
                }
            </div>
        </div>
    }
    <div class="row" style="text-align: center">
        @Html.PagedListPager((IPagedList)Model.Followers,
                page => Url.Action("Index", "Profile",
        new { username = Model.Username, page = page }),
        PagedListRenderOptions.OnlyShowFivePagesAtATime)
    </div>
</div>