{#
  Variables
    - sourceType
    - campaignId
    - names
#}
{% set sourceType = sourceType|default(null) %}

{% if update is not defined or update is empty %}
  <div id="CampaignEvent_{{ sourceType }}" data-type="source" class="draggable list-campaign-source list-campaign-leadsource">
{% endif %}
<div class="campaign-event-content">
    <div class="h5 fw-b mb-5 campaign-source-title">{{'mautic.campaign.form.lead_source'|trans}}</div>
    <div><span class="campaign-event-name ellipsis" title="{{ names|default(null) }}"><i class="mr-xs campaign-event-icon {% if 'lists' == sourceType %}ri-pie-chart-line{% else %}ri-survey-line{% endif %}"></i>{{ names|default(null) }}</span></div>
</div>

{% if update is not defined or update is empty %}
  <div class="campaign-event-buttons hide">
    {% include '@MauticCore/Helper/button.html.twig' with {
      buttons: [
          {
              href: path('mautic_campaignsource_action', {
                  'objectAction': 'edit',
                  'objectId': campaignId,
                  'sourceType': sourceType
              }),
              variant: 'secondary',
              icon: 'ri-edit-line',
              size: 'xs',
              icon_only: true,
              label: 'mautic.campaign.event.edit.btn.tooltip'|trans,
              attributes: {
                  'data-toggle': 'ajaxmodal',
                  'data-prevent-dismiss': 'true',
                  'data-target': '#CampaignEventModal',
                  'class': 'btn-edit'
              }
          },
          {
              href: path('mautic_campaignsource_action', {
                  'objectAction': 'delete',
                  'objectId': campaignId,
                  'sourceType': sourceType
              }),
              variant: 'primary',
              danger: true,
              icon: 'ri-close-line',
              size: 'xs',
              icon_only: true,
              label: 'mautic.campaign.event.remove.btn.tooltip'|trans,
              attributes: {
                  'data-toggle': 'ajax',
                  'data-target': 'CampaignEvent_' ~ sourceType,
                  'data-ignore-formexit': 'true',
                  'data-method': 'POST',
                  'data-hide-loadingbar': 'true',
                  'class': 'btn-delete'
              }
          }
      ]
  } %}
  </div>
</div>
{% endif %}
