{% extends "base.html" %}

{% block content %}
<div class="container mt-5">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1>Tenders for {{ company.name }}</h1>
        <a href="{% url 'create_tender' company.id %}" class="btn btn-primary">Create Tender</a>
    </div>

    {% if tenders %}
        <ul class="list-group">
            {% for tender in tenders %}
                <li class="list-group-item d-flex justify-content-between align-items-center">
                    <a href="{% url 'tender_detail' tender.id %}">{{ tender.title }}</a>
                    <div>
                        <a href="{% url 'update_tender' tender.id %}" class="btn btn-sm btn-outline-primary">Update</a>
                        <a href="{% url 'delete_tender' tender.id %}" class="btn btn-sm btn-outline-danger">Delete</a>
                    </div>
                </li>
            {% endfor %}
        </ul>
    {% else %}
        <div class="p-5 bg-light rounded">
            <h2>No tenders yet.</h2>
            <p class="lead">Get started by creating a new tender.</p>
        </div>
    {% endif %}
</div>
{% endblock %}
