<% is_editing = @merchant.id.present? %>
<%= styled_form_with model: @merchant, url: is_editing ? merchant_path(@merchant) : merchants_path, method: is_editing ? :patch : :post, scope: :merchant, class: "space-y-4", data: { turbo: false } do |f| %>
<%= render partial: "merchants/avatar", locals: { merchant: } %>
<%= f.hidden_field :color, data: { select_target: "input", merchant_avatar_target: "color" } %>
    <% Merchant::COLORS.each do |color| %>
  • <% end %>
<%= f.text_field :name, placeholder: t(".name_placeholder"), class: "text-sm font-normal placeholder:text-gray-500 h-10 relative pl-3 w-full border-none rounded-lg", required: true, data: { merchant_avatar_target: "name" } %>
<%= f.submit(is_editing ? t(".submit_edit") : t(".submit_create")) %>
<% end %>