{% extends "core/dashboard_base.html" %}

{% block title %}Buyer Dashboard | Ethio-gebeya{% endblock %}

{% block dashboard_content %}
<section class="grid cards-3">
  <article class="card">
    <p class="label">Total Orders</p>
    <p class="value">{{ total_orders }}</p>
  </article>
</section>

<section class="card" style="margin-top: 1rem;">
  <h2 style="margin: 0 0 0.75rem;">Recent Orders</h2>
  {% if recent_orders %}
  <table>
    <thead>
      <tr>
        <th>Order</th>
        <th>Status</th>
        <th>Date</th>
      </tr>
    </thead>
    <tbody>
      {% for order in recent_orders %}
      <tr>
        <td>#{{ order.id }}</td>
        <td>{{ order.get_status_display }}</td>
        <td>{{ order.created_at|date:"Y-m-d" }}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
  {% else %}
  <p>No orders yet.</p>
  {% endif %}
</section>
{% endblock %}
