<div class="max-w-4xl mx-auto">
  <div class="mb-6">
    <%= link_to tenant_admin_email_templates_path(website_id: @website&.id), class: "inline-flex items-center text-sm text-gray-600 hover:text-gray-800" do %>
      <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
      </svg>
      Back to Email Templates
    <% end %>
  </div>

  <div class="mb-6 flex items-center justify-between">
    <div>
      <h1 class="text-3xl font-bold text-gray-900">Edit Email Template</h1>
      <p class="mt-2 text-gray-600">
        <span class="font-medium"><%= @email_template.name %></span>
        <% if @website %>
          <span class="text-gray-400 ml-2">for <span class="font-mono"><%= @website.subdomain %></span></span>
        <% end %>
      </p>
    </div>
    <%= link_to preview_tenant_admin_email_template_path(@email_template),
                class: "inline-flex items-center px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50" do %>
      <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
      </svg>
      Preview
    <% end %>
  </div>

  <%= render 'form' %>
</div>
