{% extends 'public_frontend/base.html' %}
{% block title %}Materials{% endblock %}
{% block content %}
<div class="bg-white rounded shadow overflow-hidden">
  <table class="min-w-full text-sm">
    <thead class="bg-gray-50 text-left">
      <tr>
        <th class="px-4 py-2">Name</th>
        <th class="px-4 py-2">Category</th>
        <th class="px-4 py-2">Default Unit</th>
      </tr>
    </thead>
    <tbody>
      {% for m in materials %}
        <tr class="border-t">
          <td class="px-4 py-2">{{ m.name }}</td>
          <td class="px-4 py-2">{{ m.category.name }}</td>
          <td class="px-4 py-2">{{ m.get_default_unit_display }}</td>
        </tr>
      {% empty %}
        <tr><td colspan="3" class="px-4 py-6 text-center text-gray-500">No materials published.</td></tr>
      {% endfor %}
    </tbody>
  </table>
  </div>
{% endblock %}

