@page
@model TaxBaik.Web.Pages.Admin.Faqs.IndexModel
@{ ViewData["Title"] = "FAQ"; }

<section class="admin-page-shell">
    @await Html.PartialAsync("_AdminPageHeader", new TaxBaik.Web.Models.AdminPageHeaderModel("Support", "FAQ 관리", "질문과 답변을 관리합니다.", "/admin/faqs/create", "FAQ 작성"))
    @if (Model.Items.Count == 0)
    {
        <div class="card">
            <div class="card-body">
                @await Html.PartialAsync("_EmptyState", "FAQ가 없습니다.")
            </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>@item.Question</td>
                            <td>@item.Category</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/faqs/@item.Id">상세</a>
                                    <a class="btn btn-sm btn-primary" href="/admin/faqs/@item.Id/edit">수정</a>
                                </div>
                            </td>
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>
    }
</section>









