<div class="max-w-2xl mx-auto">
  <div class="mb-6">
    <h1 class="text-2xl font-bold text-gray-900">Edit Sale Listing</h1>
    <p class="mt-1 text-gray-600">
      Property: <%= @realty_asset.reference %>
      <% if @sale_listing.active? %>
        <span class="ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-600 text-white">Active</span>
      <% end %>
    </p>
  </div>

  <div class="bg-white rounded-lg shadow p-6">
    <%= form_with model: @sale_listing, url: site_admin_prop_sale_listing_path(@realty_asset, @sale_listing), method: :patch, local: true do |f| %>
      <%= render 'form', f: f, listing: @sale_listing %>

      <div class="flex justify-between items-center mt-6 pt-6 border-t border-gray-200">
        <%= link_to 'Cancel', edit_sale_rental_site_admin_prop_path(@realty_asset), class: 'text-gray-600 hover:text-gray-800' %>
        <%= f.submit 'Update Sale Listing', class: 'px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 cursor-pointer' %>
      </div>
    <% end %>
  </div>
</div>
