{#
Required vars: currentMedia, currentMediaUrl, mediaType
#}
{% set svgLinkIcon %}
  {% include '@AutoAdminMedia/Form/icon/link_icon.svg' %}
{% endset %}
{% set svgMissingMediaIcon %}
  {% include '@AutoAdminMedia/Form/icon/missing_media.svg' %}
{% endset %}
<div class="preview {% if currentMedia|default() is empty %}missing-media{% endif %}">
  <div class="preview-wrap">
    {% if mediaType|default() == 'image' %}
      <img class="preview-el" src="{{ currentMediaUrl|default() }}" title="{{ currentMedia.currentTranslation.fileName }}"/>
    {% elseif mediaType|default() == 'file' %}
      <a class="preview-el" href="{{ currentMediaUrl|default() }}" target="_blank">
        <i class="fa-light fa-file"></i> {{ currentMedia.currentTranslation.fileName }}
      </a>
    {% endif %}
    <div class="no-media-icon">{{ svgMissingMediaIcon }}</div>
    {% if currentMediaUrl|default() is not empty %}
      <a href="{{ currentMediaUrl|default() }}"
         target="_blank"
         class="media-link"
         title="Voir en ligne"
      >{{ svgLinkIcon|default()|raw }} {{ currentMediaUrl|default() }}</a>
    {% endif %}
  </div>
</div>