<% creative_concepts = creative_concepts.accessible_by(current_ability) %>
<% context ||= @team %>
<% hide_actions ||= false %>
<% hide_back ||= false %>

<% pagy ||= nil %>
<% pagy, creative_concepts = pagy(creative_concepts, page_param: :creative_concepts_page) unless pagy %>

<%= cable_ready_updates_for context, :scaffolding_absolutely_abstract_creative_concepts do %>
  <%= render 'account/shared/box' do |box| %>
    <% box.title t(".contexts.#{context.class.name.underscore}.header") %>
    <% box.description do %>
      <%= t(".contexts.#{context.class.name.underscore}.description").html_safe %>
      <%= render "shared/limits/index", model: creative_concepts.model %>
    <% end %>

    <% if creative_concepts.any? %>
      <% box.table do %>
        <table class="table">
          <thead>
            <tr>
              <th><%= t('.fields.name.heading') %></th>
              <%# 🚅 super scaffolding will insert new field headers above this line. %>
              <th><%= t('.fields.created_at.heading') %></th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            <%= render partial: 'account/scaffolding/absolutely_abstract/creative_concepts/creative_concept', collection: creative_concepts %>
          </tbody>
        </table>
      <% end %>
    <% end %>

    <% box.actions do %>
      <% unless hide_actions %>
        <% if can? :create, Scaffolding::AbsolutelyAbstract::CreativeConcept.new(team: @team) %>
          <%= link_to t('.buttons.new'), [:new, :account, @team, :scaffolding_absolutely_abstract_creative_concept], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} new" %>
        <% end %>

        <%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %>
        <%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
        <%= render "shared/bulk_action_select" if creative_concepts.any? %>

        <%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} back" unless hide_back %>
      <% end %>
    <% end %>
  <% end %>
<% end %>