{% extends "recipes/base.html.jinja" %}

{% import "macros/recipes.html.jinja" as recipe_macros with context %}
{% import "macros/textures.html.jinja" as texture_macros with context %}
{% import "macros/formatting.html.jinja" as fmt with context %}

{% block recipe_class -%}
  smelting-recipe recipe
{%- endblock %}

{% block title_value -%}
  {{ recipe.result.name }}
{%- endblock %}

{% block content %}
  <div class="smelting-input recipe-item-slot">
    {{ recipe_macros.render_ingredients(recipe.ingredient) }}
  </div>

  <div class="smelting-result recipe-item-slot">
    {{ texture_macros.render_item(recipe.result) }}
  </div>

  {{ extra_info(
    item_id="minecraft:lava_bucket",
    text=_("hexdoc.recipe.smelting.cooktime").format(
      ("<span class='cooktime-highlight'>"~(recipe.cookingtime / 20)~"</span>")|safe,
    ),
  ) }}

  {{ extra_info(
    "minecraft:experience_bottle",
    _("hexdoc.recipe.smelting.exp").format(
      ("<span class='exp-highlight'> "~recipe.experience~" </span>")|safe,
    ),
  ) }}
{% endblock content %}

{# TODO: move somewhere more sensible #}
{% macro extra_info(item_id, text, classes="") -%}
  <div class="extra-info {{classes}}">
    {{ texture_macros.render_item(item_id|hexdoc_item)}}
    <span class="extra-info-desc">{{ text }}</span>
  </div>
{%- endmacro %}
