{#
/**
 * @file
 * Theme override for an image field widget.
 *
 * Available variables:
 * - attributes: HTML attributes for the containing element.
 * - data: Render elements of the image widget.
 *
 * @see \Drupal\image\Hook\ImageThemeHooks::preprocessImageWidget()
 */
#}
{{ attach_library('seven/classy.image-widget') }}

<div{{ attributes }}>
  {% if data.preview %}
    <div class="image-preview">
      {{ data.preview }}
    </div>
  {% endif %}
  <div class="image-widget-data">
    {# Render widget data without the image preview that was output already. #}
    {{ data|without('preview') }}
  </div>
</div>
