{#
/**
 * @file
 * CivicTheme Iframe component.
 *
 * Props:
 * - theme: [string] Theme variation (light or dark).
 * - url: [string] Iframe URL.
 * - width: [integer] Iframe width.
 * - height: [integer] Iframe height.
 * - vertical_spacing: [string] Vertical spacing position (top, bottom, both).
 * - with_background: [boolean] Whether to include a background.
 * - attributes: [string] Additional HTML attributes.
 * - modifier_class: [string] Additional CSS classes.
 */
#}

{% set with_background_class = with_background ? 'ct-iframe--with-background' : '' %}
{% set vertical_spacing_class = vertical_spacing in ['top', 'bottom', 'both'] ? 'ct-vertical-spacing-inset--%s'|format(vertical_spacing) : '' %}
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
{% set modifier_class = '%s %s %s %s'|format(theme_class, vertical_spacing_class, with_background_class, modifier_class|default('')) %}

<iframe
  class="ct-iframe {{ modifier_class -}}"
  {% if url %}src="{{ url }}"{% endif %}
  {% if width %}width="{{ width }}"{% endif %}
  {% if height %}height="{{ height }}"{% endif %}
  {% if attributes is not empty %}{{- attributes|raw -}}{% endif %}
></iframe>
