@extends('mobile.layouts.app')

@section('content')
<div id="board" class="container">
    <div class="row">
        <div class="col align-self-end">
            <h5 class="board-name">{{ $board->name }}</h5>
        </div>
        <div class="col align-self-center text-end">
            @if($boardMeta->use_inform_modal)
            {{-- 게시판 이용안내 --}}
            <button type="button" class="btn btn-default btn-sm" data-bs-toggle="modal" data-bs-target="#boardGuideModal" title="게시판 이용안내">
                이용안내
            </button>

            <div class="modal fade" id="boardGuideModal" tabindex="-1" aria-labelledby="boardGuideModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered">
                    <div class="modal-content">
                        <div class="modal-header bg-dark text-white">
                            <strong class="modal-title" id="boardGuideModalLabel">이용안내</strong>
                            <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
                        </div>
                        <div class="modal-body text-start">
                            {!! $boardMeta->inform_content !!}
                        </div>
                        <div class="modal-footer justify-content-center">
                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
                        </div>
                    </div>
                </div>
            </div>
            @endif
        </div>
    </div>
    <hr/>
    <div id="boardList">

        {{-- 상단 광고 --}}
        @if($boardMeta->pc_header_content)
            <div class="head">
                {!! $boardMeta->pc_header_content !!}
            </div>
        @endif

        <div class="body">
            @if($boardMeta->use_personal)
                {{-- 1:1문의 --}}
                @include('mobile.board.component.inquiry')
            @elseif($boardMeta->board_layout_type == BOARD_LAYOUT_TYPE_0)
                {{-- 공지/일반 게시판 --}}
                @include('mobile.board.component.post')
            @elseif($boardMeta->board_layout_type == BOARD_LAYOUT_TYPE_1)
                {{-- 사진/동영상 게시판--}}
                @include('mobile.board.component.media')
            @endif

            {{-- 검색 --}}
            @include('mobile.board.component.search')
        </div>

        {{-- 하단 광고 --}}
        @if($boardMeta->pc_footer_content)
            <div class="foot">
                {!! $boardMeta->pc_footer_content !!}
            </div>
        @endif
    </div>
</div>
@endsection

@push('styles')
    <link rel="stylesheet" href="{{ asset('css/mobile/board/index.css') }}"/>
@endpush

@push('scripts')
    <script src="{{ asset('js/board/index.js') }}" defer></script>
@endpush
