<%= sky_section_tag("Tags") do %>
  <% if post.tags_array.any? %>
    <% tags_array =
             (
               if post.tags_array.is_a?(Hash)
                 post.tags_array
               else
                 { "general" => post.tags_array }
               end
             ) %>
    <div class="flex flex-wrap gap-2">
      <% tag_category_order.each do |category| %>
        <% (tags_array[category.to_s] || []).each do |tag| %>
          <span
                class="<%= tailwind_tag_category_class(category) %> rounded px-2 py-1 text-sm text-slate-600"
              >
            <% icon = font_awesome_category_icon(category) %>
            <% if icon %>
              <i class="fa-solid <%= icon %> mr-1"></i>
            <% end %>
            <%= tag %>
          </span>
        <% end %>
      <% end %>
    </div>
  <% else %>
    <div class="text-center italic text-slate-400">No tags</div>
  <% end %>
<% end %>
