{% set firstView = fsc.views | first %}
{% set file = firstView.model %}

<div class="card shadow mb-3">
    <div class="card-body">
        <div class="dropdown">
            <button class="btn btn-outline-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
                <i class="fas fa-cloud-download-alt"></i> {{ trans('download') }}
            </button>
            <div class="dropdown-menu">
                <a class="dropdown-item" target="_blank" href="{{ asset(file.url('download')) }}">
                    <i class="fa-regular fa-hourglass-half fa-fw mr-1"></i> {{ trans('valid-for-day') }}
                </a>
                <a class="dropdown-item" target="_blank" href="{{ asset(file.url('download-permanent')) }}">
                    <i class="fa-solid fa-circle-check fa-fw mr-1"></i> {{ trans('unlimited') }}
                </a>
            </div>
        </div>
    </div>
    {% if file.isImage() %}
        <img src="{{ asset(file.url('download')) }}" class="card-img-top" alt="{{ file.filename }}" />
    {% elseif file.isVideo() %}
        <div class="embed-responsive embed-responsive-16by9">
            <video width="320" height="240" controls>
                <source src="{{ asset(file.url('download-permanent')) }}" type="video/mp4" />
            </video>
        </div>
    {% elseif file.getExtension() == 'pdf' %}
        <div class="embed-responsive embed-responsive-16by9">
            <embed src="{{ asset(file.url('download-permanent')) }}" type="application/pdf" />
        </div>
    {% endif %}
</div>