<tr id="<%= dom_id job %>" class="bg-status-<%= job.status %>-light odd:bg-opacity-25 even:bg-opacity-15 text-hsrm-gray whitespace-nowrap hover:bg-opacity-30" data-stream-enter-class="animate-flash-increase">
  <td class="p-2 py-3 text-center">
    <span class="badge badge-xl text-status-<%= job.status %> bg-status-<%= job.status %>-light rounded-lg shadow">
    <% # TODO: Refactor to helper function %>
    <% if defined?(no_turbo_stream) && no_turbo_stream %>
      <%= turbo_frame_tag dom_id(job, :badge) do %>
        <%= render partial: "jobs/badge", locals: { job: job } %>
      <% end %>
    <% else %>
      <%= turbo_frame_tag dom_id(job, :badge), src: badge_job_path(job), loading: 'lazy' do %>
        <%= icon("ellipsis-horizontal-circle", class: "icon icon-disabled size-10", title: "Loading...") %>
      <% end %>
    <% end %>
    </span>
  </td>
  <td class="p-2 py-3 text-center">
    <% if job.pdf.attached? && job.pdf.previewable? %>
      <%= image_tag(url_for(job.pdf.blob.preview(resize_to_limit: [100, 100])), class: "shadow") %>
      <%# = image_tag job.pdf.preview(resize_to_limit: [50, 50]), class: "mx-auto" %>
    <% end %>
  </td>
  <td class="p-2 py-3">
    <%= job.customer_fullname %>
  </td>
  <td class="p-2 py-3">
    <% if job.pdf.attached? %>
      <%= truncate(job.pdf.filename.to_s, length: 45) %>
    <% end %>
  </td>
  <td class="p-1 py-3">
    <span class="badge">
      <%= job.number_of_plans_a0 %>
    </span>
  </td>
  <td class="p-1 py-3">
    <span class="badge">
      <%= job.number_of_plans_a1 %>
    </span>
  </td>
  <td class="p-1 py-3">
    <span class="badge">
      <%= job.number_of_plans_a2 %>
    </span>
  </td>
  <td class="p-1 py-3">
    <span class="badge">
      <%= job.number_of_plans_a3 %>
    </span>
  </td>
  <td class="p-2 py-3 text-right">
    <span class="badge">
      <%=  number_with_delimiter job.costum_qm_plan.round(2)  %> m²
    </span>
  </td>
  <td class="w-24 p-2 py-3 text-right">
    <span class="badge">
      <%= number_to_currency job.cost, locale: :de %>
    </span>
  </td>
  <td class="p-2 py-3">
    <span class="badge badge-status text-status-<%= job.status.to_sym %> bg-status-<%= job.status %>-light ">
      <%= job.status %>
    </span>
  </td>
  <% unless defined?(no_actions) && no_actions %>
    <td class="p-2 py-3 text-right">
      <% # TODO: Refactor to helper function %>
      <% if defined?(no_turbo_stream) && no_turbo_stream %>
        <%= turbo_frame_tag dom_id(job, :cancel_button) do %>
          <%= render partial: "jobs/cancel_button", locals: { job: job } %>
        <% end %>
      <% else %>
        <%= turbo_frame_tag dom_id(job, :cancel_button), src: cancel_button_job_path(job), loading: 'lazy' do %>
          <%= icon("ellipsis-horizontal-circle", class: "icon icon-disabled size-10", title: "Loading...") %>
        <% end %>
      <% end %>
    <% end %>
  </td>
</tr>
