@extends(get_theme().'.layouts')

@section('content')
<div class="row mb-3">
    <div class="col-12 col-md-2 mb-3">
        <img class="img-fluid rounded" src="{{ img_poster($data->profile_path) }}" alt="{{ $data->name }}">
    </div>
    <div class="col-12 col-md-10">
        <h1 class="h3 mb-4">{{ $data->name }}</h1>
        <div class="h6">{{ __('utilities.biography') }}</div>
        <p class="text-muted" style="max-height: 200px; overflow:auto">{{ $data->biography }}</p>
        <div class="entry-table">
            <ul class="list-unstyled">
                <li>{{ __('utilities.know_for') }}: <span>{{ $data->known_for_department }}</span></li>
                <li>{{ __('utilities.birthday') }}: <span>{{ $data->birthday }}</span></li>
                <li>{{ __('utilities.place_of_birth') }}: <span>{{ $data->place_of_birth }}</span></li>
                <li>{{ __('utilities.also_know_as') }}: <span>{{ implode($data->also_known_as, ', ') }}</span></li>
            </ul>
        </div>
    </div>
</div>

<div class="card">
    <div class="card-header">
        <div class="card-title h3 mb-0">{{ __('section.title.movie_list_of', ['name' => $data->name]) }}</div>
    </div>
    <div class="card-body">
        <div class="row">
            @foreach (block_id_lists($data->movie_credits->cast) as $item)
                <div class="col-md-3 mb-3">
                    <div class="media position-relative">
                        <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->title }}" title="Image {{ $item->title }} ({{ to_year($item->release_date ?? '') }})">
                        <div class="media-body">
                            <a href="{{ mopie_route('movie.single',['id' => $item->id, 'slug' => str_slug($item->original_title)]) }}" rel="bookmark" title="{{ $item->title }} ({{ to_year($item->release_date ?? '') }})" class="stretched-link">
                                <h2 class="card-title h6 m-1">{{ $item->title }}</h2>
                            </a>
                            <p class="small text-secondary">{{ $item->release_date ?? '' }}</p>
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
</div>
@endsection