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

{% block title %}{{ page_title }}{% endblock %}

{% block content %}
<div class="main-content-header">
  <h1>Overview</h1>
</div>
<div class="card">
    <div class="card-header">
        <h3>Businesses</h3>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th>Business Name</th>
                        <th>Industry</th>
                        <th>Services</th>
                        <th>Calls</th>
                        <th>Bookings</th>
                    </tr>
                </thead>
                <tbody>
                    {% for business in businesses %}
                    <tr>
                        <td><a href="{% url 'business_detail' business.id %}">{{ business.business_name }}</a></td>
                        <td>{{ business.get_industry_display }}</td>
                        <td>{{ business.service_count }}</td>
                        <td>{{ business.call_count }}</td>
                        <td>{{ business.booking_count }}</td>
                    </tr>
                    {% empty %}
                    <tr>
                        <td colspan="5">No businesses found.</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}