<% content_for :title, "Indicium #{@usps_indicium.public_id}" %>

<div class="container">
  <header class="page-header mb-6">
    <div class="flex items-center gap-4">
      <%= link_to "← Back", usps_indicia_path, class: "text-gray-500 hover:text-gray-700" %>
      <div>
        <h1>Indicium</h1>
        <div class="text-sm text-gray-500 font-mono"><%= @usps_indicium.public_id %></div>
      </div>
    </div>
    <div class="actions flex gap-2">
      <%= link_to edit_usps_indicium_path(@usps_indicium), class: "btn btn-small" do %>
        Edit
      <% end %>
      <%= button_to usps_indicium_path(@usps_indicium), method: :delete, class: "btn danger btn-small", data: { confirm: "Delete this indicium?" } do %>
        Delete
      <% end %>
    </div>
  </header>

  <div class="max-w-2xl">
    <article>
      <header><h2>Postage Details</h2></header>
      <div class="p-4">
        <dl class="grid md:grid-cols-2 gap-4 text-sm">
          <div>
            <dt class="text-gray-500">Postage</dt>
            <dd class="font-medium text-lg"><%= number_to_currency(@usps_indicium.postage) %></dd>
          </div>
          <div>
            <dt class="text-gray-500">Mailing Date</dt>
            <dd><%= @usps_indicium.mailing_date %></dd>
          </div>
          <div>
            <dt class="text-gray-500">USPS SKU</dt>
            <dd class="font-mono text-xs"><%= @usps_indicium.usps_sku %></dd>
          </div>
          <div>
            <dt class="text-gray-500">Processing Category</dt>
            <dd><%= @usps_indicium.processing_category %></dd>
          </div>
        </dl>
      </div>
    </article>

    <article class="mt-6">
      <header><h2>Dimensions</h2></header>
      <div class="p-4">
        <dl class="grid md:grid-cols-2 gap-4 text-sm">
          <div>
            <dt class="text-gray-500">Weight</dt>
            <dd><%= @usps_indicium.postage_weight %> oz</dd>
          </div>
          <div>
            <dt class="text-gray-500">Length</dt>
            <dd><%= @usps_indicium.postage_length %>"</dd>
          </div>
          <div>
            <dt class="text-gray-500">Height</dt>
            <dd><%= @usps_indicium.postage_height %>"</dd>
          </div>
          <div>
            <dt class="text-gray-500">Thickness</dt>
            <dd><%= @usps_indicium.postage_thickness %>"</dd>
          </div>
          <div>
            <dt class="text-gray-500">Non-machinable</dt>
            <dd><%= @usps_indicium.nonmachinable ? "Yes" : "No" %></dd>
          </div>
        </dl>
      </div>
    </article>

    <%= render partial: "admin_inspector", locals: { record: @usps_indicium } %>
  </div>
</div>
