@extends('mobile.layouts.app')
@section('content')
<div id="movieCompanyView" class="container-fluid">

    <div class="row g-2 align-items-center">
        <div class="col">
            <h5 class="mb-0 fw-bold">{{ $companyNm }}</h5>
        </div>
        <div class="col-auto text-end">
            <a href="{{ $listURL }}" class="btn btn-sm btn-default" target="_self">목록으로</a>
        </div>
    </div>
    <hr/>

    <label class="form-label">기본 정보</label>
    <table class="table table-borderless">
        <colgroup>
            <col width="80px"/>
            <col width="*"/>
        </colgroup>
        <tr>
            <th>대표자</th>
            <td>{{ $info->ceoNm ?: '-' }}</td>
        </tr>
        <tr>
            <th>분류</th>
            <td>
                @if(!empty($info->parts))
                    @foreach($info->parts as $part)
                        {{ $part->companyPartNm }}@if(!$loop->last), @endif
                    @endforeach
                @else
                    -
                @endif
            </td>
        </tr>
    </table>
    <hr/>

    <section class="filmo">
        <h5>필모그래피 @if(!empty($info->filmos))<small class="text-secondary">({{ count($info->filmos) }})</small>@endif</h5>
        @if(!empty($info->filmos))
        <table class="table table-hover align-middle">
            <colgroup>
                <col width="*"/>
                <col width="90px"/>
            </colgroup>
            <tbody>
            @foreach($info->filmos as $filmo)
                <tr>
                    <td>
                        <a href="{{ route('movie.search.show', base64_encode($filmo->movieCd)) }}" target="_self">
                            {{ $filmo->movieNm }}
                        </a>
                    </td>
                    <td class="text-center"><small>{{ $filmo->companyPartNm }}</small></td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @else
        <blockquote>-</blockquote>
        @endif
    </section>
</div>
@endsection
