{% extends 'base.html' %}
{% block title %}Repairs Report{% endblock %}

{% block content %}

<div class="container page-container">

    <div class="page-header mb-3">
        <h4><i class="bi bi-tools"></i> Repairs Report</h4>
    </div>

    <div class="card shadow-sm p-3">

        {% for repair in repairs %}
        <div class="list-card mb-3 p-3 border rounded">

            <div class="d-flex justify-content-between">
                <strong>{{ repair.tenant.username|default:"Unknown Tenant" }}</strong>
                <span class="badge bg-warning text-dark">{{ repair.status|default:"pending" }}</span>
            </div>

            <p class="mb-1">{{ repair.issue|default:"No description" }}</p>

            {% if repair.cost %}
                <p><strong>Cost:</strong> KES {{ repair.cost }}</p>
            {% endif %}

        </div>
        {% empty %}
        <p class="text-center text-muted">No repair records available.</p>
        {% endfor %}

    </div>

</div>

{% endblock %}