@model TaxBaik.Web.Pages.Shared.PaginationModel
@if (Model.TotalPages > 1)
{
    <nav class="mt-4" aria-label="페이지네이션">
        <ul class="pagination">
            <li class="page-item @(Model.Page <= 1 ? "disabled" : "")">
                <a class="page-link" href="@(Model.Page <= 1 ? "#" : Model.BuildPageUrl(Model.Page - 1))" tabindex="@(Model.Page <= 1 ? -1 : 0)" aria-disabled="@(Model.Page <= 1 ? "true" : "false")">이전</a>
            </li>
            @for (var i = 1; i <= Model.TotalPages; i++)
            {
                <li class="page-item @(i == Model.Page ? "active" : "")">
                    <a class="page-link" href="@Model.BuildPageUrl(i)" @(i == Model.Page ? "aria-current=\"page\"" : "")>@i</a>
                </li>
            }
            <li class="page-item @(Model.Page >= Model.TotalPages ? "disabled" : "")">
                <a class="page-link" href="@(Model.Page >= Model.TotalPages ? "#" : Model.BuildPageUrl(Model.Page + 1))" tabindex="@(Model.Page >= Model.TotalPages ? -1 : 0)" aria-disabled="@(Model.Page >= Model.TotalPages ? "true" : "false")">다음</a>
            </li>
        </ul>
    </nav>
}
