{#
Title: Single Image Block
Description: A single image with position options and citation-style description
Category: formatting
Icon: format-image
Mode: preview
Align: full
SupportsAlign: full false
#}

{% extends '/views/parts/logic/block-settings.twig' %}

{% block blocksettings %}
    {% set image = fields.image ?? null %}
    {% set position = fields.position ?? 'center' %}
    {% set description = fields.description ?? '' %}

    <section class="single-image-block single-image-block--{{ position }} {{ outer_classes }}">
        {% if image %}
            <div class="{{ inner_classes }}">
                <figure class="single-image-block__figure">
                    <div class="single-image-block__media">
                        {{ include('views/parts/image.twig', { image: image }) }}
                    </div>

                    {% if description %}
                        <figcaption class="single-image-block__citation">
                            <cite>{{ description|nl2br }}</cite>
                        </figcaption>
                    {% endif %}
                </figure>
            </div>
        {% endif %}
    </section>
{% endblock %}