<div class="tab-pane fade bdr-w-0" id="dealflow-deals-container">
    {% if dealflowContactDeals is empty %}
        <div class="alert alert-info">
            <p>{{ 'mautic.dealflow.contact.deals.empty'|trans }}</p>
        </div>
    {% else %}
        <div class="table-responsive">
            <table class="table table-hover table-striped table-bordered dealflow-contact-deals-table">
                <thead>
                    <tr>
                        <th>{{ 'mautic.dealflow.contact.deals.col.title'|trans }}</th>
                        <th>{{ 'mautic.dealflow.contact.deals.col.pipeline'|trans }}</th>
                        <th>{{ 'mautic.dealflow.contact.deals.col.stage'|trans }}</th>
                        <th>{{ 'mautic.dealflow.contact.deals.col.amount'|trans }}</th>
                        <th>{{ 'mautic.dealflow.contact.deals.col.status'|trans }}</th>
                        <th>{{ 'mautic.dealflow.contact.deals.col.role'|trans }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for entry in dealflowContactDeals %}
                        {% set deal = entry.deal %}
                        <tr>
                            <td>
                                <a href="{{ entry.viewUrl }}" data-toggle="ajax">
                                    {{ deal.getTitle()|purify }}
                                </a>
                            </td>
                            <td>
                                {% if deal.getPipeline() %}
                                    {{ deal.getPipeline().getName()|purify }}
                                {% else %}
                                    <span class="text-muted">{{ 'mautic.dealflow.contact.deals.no_pipeline'|trans }}</span>
                                {% endif %}
                            </td>
                            <td>
                                {% if deal.getStage() %}
                                    {{ deal.getStage().getName()|purify }}
                                {% else %}
                                    <span class="text-muted">{{ 'mautic.dealflow.company.box.no_stage'|trans }}</span>
                                {% endif %}
                            </td>
                            <td>
                                {{ include('@DealFlow/Deal/_amount.html.twig', {amount: deal.getAmount(), currency: deal.getCurrency(), compact: true}, false) }}
                            </td>
                            <td>
                                {% set statusClass = deal.getStatus() == 'open' ? 'primary' : (deal.getStatus() == 'won' ? 'success' : 'danger') %}
                                <span class="label label-{{ statusClass }}">{{ deal.getStatus()|capitalize }}</span>
                            </td>
                            <td>
                                {% if entry.role %}
                                    {{ entry.role|purify }}
                                {% else %}
                                    <span class="text-muted">{{ 'mautic.dealflow.contact.deals.no_role'|trans }}</span>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    {% endif %}
</div>
