<%= cs.skill.name %>
XP<%= cs.xp %>
<%= cs.level %>
<% @character.item_infixes.where(skill: cs.skill).each do |ii| %>
<%= render "characters/skills/infix_slot" do %>
<%= ii.item.name %>
<%= button_to "Remove", character_item_infix_path(id: ii.id), method: :delete %>
<% end %>
<% end %>
<% @character.available_infixes(cs.skill).times do %>
<%= render "characters/skills/infix_slot" do %>
<%# TODO: Don't load all into memory %>
<% infixable_items = @character.items.select {|i| i.infixable?(cs.skill)} %>
<% if infixable_items.any? %>
<%= form_with url: character_item_infixes_path, class: "w-full" do |f| %>
<%= f.select :item_id, infixable_items.map { |i| [i.name, i.id]}, {}, class: "w-full" %>
<%= f.hidden_field :skill_id, value: cs.skill.id %>
<%= f.submit "Infix" %>
<% end %>
<% else %>
No items to infix.
<% end %>
<% end %>
<% end %>