@page "{id:int}"
@model Admin.Pages.Forum.Comments.List.EditModel
@{
    ViewData["Title"] = "댓글 상세";
}

<div class="container-fluid">
    <h3>@ViewData["Title"]</h3>
    <hr />

    <partial name="_StatusMessage" />

    <div class="table-responsive">
        <table class="table table-striped table-bordered">
            <colgroup>
                <col style="width: 15%;" />
                <col />
            </colgroup>
            <tr>
                <th>ID</th>
                <td>@Model.CommentID</td>
            </tr>
            <tr>
                <th>게시판</th>
                <td>@Model.BoardName</td>
            </tr>
            <tr>
                <th>게시글</th>
                <td><a href="/Forum/Posts/List/Edit/@Model.PostID">@Model.PostSubject</a></td>
            </tr>
            <tr>
                <th>작성자</th>
                <td>@(Model.Name ?? Model.SID ?? "-")</td>
            </tr>
            <tr>
                <th>내용</th>
                <td><pre class="mb-0" style="white-space:pre-wrap;">@Model.CommentContent</pre></td>
            </tr>
            <tr>
                <th>상태</th>
                <td>
                    @if (Model.IsDeleted) { <span class="badge text-bg-danger me-1">삭제</span> }
                    @if (Model.IsSecret) { <span class="badge text-bg-secondary me-1">비밀</span> }
                    @if (Model.IsReply) { <span class="badge text-bg-info me-1">답글</span> }
                </td>
            </tr>
            <tr>
                <th>좋아요 / 싫어요</th>
                <td>@Model.Likes / @Model.Dislikes</td>
            </tr>
            <tr>
                <th>신고</th>
                <td>@Model.Reports</td>
            </tr>
            <tr>
                <th>답글 수</th>
                <td>@Model.Replies</td>
            </tr>
            <tr>
                <th>작성일</th>
                <td>@Model.CreatedAt</td>
            </tr>
            <tr>
                <th>수정일</th>
                <td>@Model.UpdatedAt</td>
            </tr>
        </table>
    </div>

    <div class="row g-2 justify-content-center">
        <div class="col-auto">
            <form method="post" style="display:inline">
                <input type="hidden" name="id" value="@Model.CommentID" />
                <button type="submit" asp-page-handler="Delete" class="btn btn-danger" onclick="return confirm('이 댓글을 삭제하시겠습니까?')">삭제</button>
            </form>
            <a href="/Forum/Comments/List/Index@(Model.QueryString)" class="btn btn-secondary">목록</a>
        </div>
    </div>
</div>
