<%= turbo_frame_tag dom_id(@media_folder, :form) do %>
  <%= form_with model: [:admin, @media_folder], data: {turbo_frame: "_top"} do |f| %>
    <div class="px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
      <div class="sm:flex sm:items-start">
        <div class="w-full">
          <h3 class="text-lg leading-6 font-medium text-gray-900">
            <% if @media_folder.persisted? %>
              <%=t 'spina.media_library.rename_folder' %>
            <% else %>
              <%=t 'spina.media_library.add_folder' %>
            <% end %>
          </h3>
    
          <div class="mt-3">
            <%= render Spina::Forms::TextFieldComponent.new(f, :name, size: 'lg', autofocus: true) %>
          </div>
    
        </div>
      </div>
    </div>
    <div class="px-4 pb-5 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
      <button type="submit" class="btn btn-primary w-full sm:w-auto sm:ml-2">
        <%=t 'spina.media_library.save_media_folder' %>
      </button>
      <button type="button" class="btn btn-default w-full sm:w-auto mt-2 sm:mt-0" data-action="modal#close">
        <%=t 'spina.ui.cancel' %>
      </button>
    </div>
  <% end %>
<% end %>