<%= turbo_frame_tag :new_store_credit_modal do %>
  <%= render component("ui/modal").new(title: t(".title")) do |modal| %>
    <%= form_for @store_credit, url: solidus_admin.user_store_credits_path(@user), method: :post, html: { id: form_id } do |f| %>
      <div class="flex flex-col gap-6 pb-4">
        <%= render component("ui/forms/field").text_field(f, :amount, class: "required") %>
        <%= render component("ui/forms/field").select(
          f,
          :currency,
          currency_select_options.html_safe,
          include_blank: t("spree.currency"),
          html: { required: true }
        ) %>
        <%= render component("ui/forms/field").select(
          f,
          :category_id,
          store_credit_categories_select_options.html_safe,
          include_blank: t("spree.category"),
          html: { required: true }
        ) %>
        <%= render component("ui/forms/field").text_field(f, :memo) %>
      </div>
      <% modal.with_actions do %>
        <form method="dialog">
          <%= render component("ui/button").new(scheme: :secondary, text: t(".cancel")) %>
        </form>
        <%= render component("ui/button").new(form: form_id, type: :submit, text: t(".submit")) %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
<%= render component("users/store_credits/index").new(user: @user, store_credits: @store_credits) %>
