@page
@model TaxBaik.Web.Pages.Admin.Announcements.IndexModel
@{ ViewData["Title"] = "공지사항"; }

<section class="admin-page-shell">
    @await Html.PartialAsync("_AdminPageHeader", new TaxBaik.Web.Models.AdminPageHeaderModel("Content", "공지사항 관리", "공지 목록을 서버 렌더링으로 표시합니다.", "/admin/announcements/create", "공지 작성"))
    @if (Model.Items.Count == 0)
    {
        <div class="card">
            <div class="card-body">
                @await Html.PartialAsync("_EmptyState", "공지사항이 없습니다.")
            </div>
        </div>
    }
    else
    {
        <div class="card">
            <div class="table-responsive">
                <table class="table table-vcenter card-table table-hover">
                    <thead>
                        <tr>
                            <th>제목</th>
                            <th>유형</th>
                            <th>활성</th>
                            <th>정렬</th>
                            <th class="text-end">작업</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Items)
                        {
                            <tr>
                                <td class="fw-semibold">@item.Title</td>
                                <td>@item.DisplayType</td>
                                <td>@await Html.PartialAsync("_StatusBadge", item.IsActive ? "active" : "inactive")</td>
                                <td>@item.SortOrder</td>
                                <td class="text-end">
                                    <div class="btn-list flex-nowrap justify-content-end">
                                        <a class="btn btn-sm btn-outline-secondary" href="/admin/announcements/@item.Id">상세</a>
                                        <a class="btn btn-sm btn-primary" href="/admin/announcements/@item.Id/edit">수정</a>
                                    </div>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    }
</section>









