{#
  Variables
    - lead
    - companies
    - companyLead
#}
<!-- start: LeadBundle:Lead:company.html.twig -->
{% set leadId = lead.id %}
<ul class="list-group">
    {% for company in companies %}
        {% set switch = companyLead[company.id] is defined ? 'ri-toggle-fill' : 'ri-toggle-line' %}
        {% set bgClass = companyLead[company.id] is defined ? 'text-success' : 'text-danger' %}
        <li class="list-group-item">
            <i class="ri-lg ri-fw {{ switch }} {{ bgClass }}"
               id="companyLeadsToggle{{ company.id }}"
               onclick="Mautic.toggleCompanyLead('companyLeadsToggle{{ company.id }}', {{ leadId }}, {{ company.id }});"></i>
            <span>{{ company.companyname|purify }}</span>
        </li>
    {% endfor %}
</ul>
<!-- end: LeadBundle:Lead:company.html.twig -->
