<table class="table">
    <caption>
        {{-- 분류/정렬/목록 수 --}}
        @include('board.component.tab')
    </caption>
    <colgroup>
        <col width="6%"/>
        @if($boardMeta->use_category)
        <col width="10%"/>
        @endif
        <col width="*"/>
        <col width="14%"/>
        <col width="14%"/>
        <col width="8%"/>
        <col width="8%"/>
    </colgroup>
    <thead>
        <tr>
            <th>번호</th>
            @if($boardMeta->use_category)
            <th>분류</th>
            @endif
            <th>제목</th>
            <th>작성자</th>
            <th>작성일</th>
            <th>조회</th>
            <th>답변 여부</th>
        </tr>
    </thead>
    <tbody>

        {{-- 공지사항 --}}
        @include('board.component.notice')

        {{-- 1:1 문의 --}}
        @if($posts->total > 0)
            @foreach($posts->list as $row)
            <tr>
                <td>{{ $row->num }}</td>
                @if($boardMeta->use_category)
                <td>
                    @if($row->categoryName)
                        <label>
                            <a href="{{ $listURL }}?category={{ $row->board_category_id }}" rel="search">
                                [{{ $row->categoryName }}]
                            </a>
                        </label>
                    @else
                        -
                    @endif
                </td>
                @endif
                <td class="text-start">
                    @if($row->is_secret)
                        <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html">
                            <i class="fas fa-lock"></i> 비밀글입니다.
                        </a>
                    @elseif($row->isBlame)
                        <i class="fas fa-ban"></i> <del>{{ $row->subject }}</del>
                    @else
                        <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html">{{ $row->subject }}</a>
                    @endif
                    @if($row->comment_rows > 0)
                        <var>[{{ $row->comment_rows }}]</var>
                    @endif
                    @if($row->file_rows > 0)
                        <i class="fas fa-save"></i>
                    @endif
                    @if($row->link_rows > 0)
                        <i class="fas fa-external-link-alt"></i>
                    @endif
                    @if($row->image_rows > 0)
                        <i class="fas fa-image"></i>
                    @endif
                    @if($row->isNew)
                        <span class="badge bg-warning text-dark">New</span>
                    @endif
                    @if($row->isHot)
                        <span class="badge bg-danger">Hot</span>
                    @endif
                </td>
                <td>{{ $row->user->name }}</td>
                <td>{{ $row->createdAt }}</td>
                <td>{{ $row->hit }}</td>
                <td>
                    @if($row->is_reply)
                        <span class="badge bg-success p-2">답변완료</span>
                    @else
                        <span class="badge bg-secondary p-2">접수완료</span>
                    @endif
                </td>
            </tr>
            @endforeach
        @else
            <tr>
                <td colspan="7" class="p-5">
                    1:1 문의글이 존재하지 않습니다.
                </td>
            </tr>
        @endif
    </tbody>

    @if($posts->total > 0)
    <tfoot>
        <tr>
            <td colspan="7">
                {{ $posts->list->onEachSide($params->pageCount)->links('desktop.board.component.pagination') }}
            </td>
        </tr>
    </tfoot>
    @endif
</table>
