{% extends 'base.html' %}
{% load static %}

{% block content %}
<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="display-4">Vendedores</h1>
        <a href="{% url 'seller_create' %}" class="btn btn-primary">Adicionar Vendedor</a>
    </div>
    
    <p class="lead">Gerencie seus vendedores.</p>

    <table class="table table-striped">
        <thead>
            <tr>
                <th>Nome</th>
                <th>Email</th>
                <th>Telefone</th>
                <th>Comissão (%)</th>
                <th>Ações</th>
            </tr>
        </thead>
        <tbody>
            {% for seller in sellers %}
            <tr>
                <td>{{ seller.name }}</td>
                <td>{{ seller.email }}</td>
                <td>{{ seller.phone }}</td>
                <td>{{ seller.commission }}</td>
                <td>
                    <a href="{% url 'seller_update' seller.pk %}" class="btn btn-sm btn-info">Editar</a>
                    <a href="{% url 'seller_delete' seller.pk %}" class="btn btn-sm btn-danger">Excluir</a>
                </td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="5" class="text-center">Nenhum vendedor cadastrado.</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}