{% extends 'base/base.html' %}
{% block title %}Deposit History - CryptoSignals Pro{% endblock %}

{% block content %}
<div class="container-fluid">
    <h1 class="page-title">Deposit History</h1>
    
    <div class="card">
        <div class="card-body">
            {% if page_obj %}
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th class="custom-text-muted">ID</th>
                            <th class="custom-text-muted">Amount</th>
                            <th class="custom-text-muted">Method</th>
                            <th class="custom-text-muted">Transaction ID</th>
                            <th class="custom-text-muted">Status</th>
                            <th class="custom-text-muted">Date</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for deposit in page_obj %}
                        <tr>
                            <td class="custom-text-muted">#{{ deposit.id }}</td>
                            <td class="custom-text-muted">${{ deposit.amount|floatformat:2 }}</td>
                            <td class="custom-text-muted">{{ deposit.get_payment_method_display }}</td>
                            <td class="custom-text-muted"><small>{{ deposit.transaction_id|truncatechars:20 }}</small></td>
                            <td>
                                <span class="badge badge-{{ deposit.status|lower }}">{{ deposit.get_status_display }}</span>
                            </td>
                            <td class="custom-text-muted">{{ deposit.created_at|date:"M d, Y" }}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
            
            {% if page_obj.has_other_pages %}
            <nav>
                <ul class="pagination justify-content-center">
                    {% if page_obj.has_previous %}
                    <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a></li>
                    {% endif %}
                    <li class="page-item active"><span class="page-link">Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span></li>
                    {% if page_obj.has_next %}
                    <li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a></li>
                    {% endif %}
                </ul>
            </nav>
            {% endif %}
            {% else %}
            <p class="text-center custom-text-muted py-4">No deposit history.</p>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
