{% trans_default_domain 'admin' %}

{% set status = offer.status|keys|sort((a, b) => b == 'completed' or b == 'cancelled' ? 1 : 0)|first %}
{% set icons = {
    draft: ['plus-circle', 'text-orange-600'],
    to_draft: ['plus-circle', 'text-orange-600'],
    to_draft_2: ['plus-circle', 'text-orange-600'],
    cancel: ['x-circle-fill', 'text-red-600'],
    cancelled: ['x-circle-fill', 'text-red-600'],
    finalize: ['check-circle', 'text-green-600'],
    finalized: ['check-circle', 'text-green-600'],
    approve: ['shield-check', 'text-green-600'],
    reviewed: ['shield-check', 'text-green-600'],
    publish: ['check-circle-fill', 'text-green-600'],
    relaunch: ['check-circle-fill', 'text-green-600'],
    published: ['check-circle-fill', 'text-green-600'],
    unpublish: ['x-circle', 'text-gray-500'],
    complete: ['check-circle-fill', 'text-blue-600'],
    completed: ['check-circle-fill', 'text-blue-600'],
} %}

{% set icon_config = icons[status] ?? null %}
{% set icon = icon_config[0] ?? 'circle' %}
{% set color = icon_config[1] ?? 'text-gray-400' %}

<span aria-label="{{ ("offers.status.#{status}")|trans([], "admin") }}"
      class="inline-flex">
    <span aria-hidden="true"
          title="{{ ("offers.status.#{status}")|trans([], "admin") }}"
          class="{{ color }} {{ size|default('size-5') }}">
        {{ ux_icon('ph:'~icon) }}
    </span>
</span>
