<% content_for :title, defined?(breadcrumb_text) ? breadcrumb_text : page_title %>

<div class="min-h-screen bg-gray-50">
  <div class="max-w-4xl mx-auto">
    <!-- Page Header -->
    <div class="mb-4">
      <nav class="flex items-center space-x-2 text-sm text-gray-500 mb-4">
        <%= link_to "Content", contents_path, class: "hover:text-gray-700" %>
        <%= heroicon("chevron", class: "w-4 h-4") %>
        <% if content&.persisted? %>
          <%= link_to content.name.presence || content_name, content, class: "hover:text-gray-700" %>
          <%= heroicon("chevron", class: "w-4 h-4") %>
          <span class="text-gray-900 font-medium">Edit</span>
        <% else %>
          <span class="text-gray-900 font-medium"><%= breadcrumb_text %></span>
        <% end %>
      </nav>
      
      <div class="flex items-center justify-between">
        <div>
          <h1 class="text-2xl font-bold text-gray-900"><%= page_title %></h1>
          <p class="text-gray-600 mt-1"><%= page_description %></p>
        </div>
        <% if content&.persisted? %>
          <div class="flex space-x-3">
            <%= link_to "View Content", content,
                class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
          </div>
        <% end %>
      </div>
    </div>

    <!-- Form -->
    <%= render "form", form_locals %>
  </div>
</div>