{% extends "pages/patchouli/text.html.jinja" %}
{% import "macros/textures.html.jinja" as texture_macros with context %}
{% import "macros/formatting.html.jinja" as fmt with context -%}

{% block inner_body %}
  <h5 class="multiblock-name">
    {{ page.name }}
  </h5>
  <details class="details-collapsible multiblock-details">
    {{ fmt.dropdown("hexdoc.multiblock") }}
    {% if page.multiblock is not none %}
      {% for item, count in page.multiblock.bill_of_materials() %}
        <div class="multiblock-ingredient">
          <div class="item-slot">
            <img
              alt="Spotlight inventory slot"
              src="{{ 'hexdoc:textures/gui/spotlight.png'|hexdoc_texture }}"
            >
            {{ texture_macros.render_item(item) }}
          </div>
          <span class="multiblock-ingredient-amount">{{ count }}x {{ item.name }}</span>
        </div>
      {% endfor %}
    {% else %}
      {{
        texture_macros.render_texture(
          name=page.name,
          texture=page.texture,
        )
      }}
    {% endif %}
  </details>
  {{ super() }}
{% endblock inner_body %}
