{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}

<div class="card customer-discounts-card">
  <h3 class="card-header">
    <i class="material-icons">loyalty</i>
    {{ 'Vouchers'|trans({}, 'Admin.Orderscustomers.Feature') }}
    <span class="badge badge-primary rounded">{{ customerDiscountGrid.data.records_total }}</span>

    <a href="{{ getAdminLink('AdminCartRules', true, {addcart_rule: 1, back: app.request.uri}) }}" class="tooltip-link float-right"
    data-toggle="pstooltip" title="" data-placement="top" data-original-title="{{ 'Add'|trans({}, 'Admin.Actions') }}">
      <i class="material-icons">add_circle</i>
    </a>
  </h3>
  <div class="card-body">
    {% if customerDiscountGrid.data.records_total > 0 %}
      {{ include('@PrestaShop/Admin/Common/Grid/grid.html.twig', {grid: customerDiscountGrid}) }}
    {% else %}
      <div class="text-center">
        <p class="text-muted mb-2">
          {{ '%firstname% %lastname% has no discount vouchers'|trans({'%firstname%': customerInformation.personalInformation.firstName, '%lastname%': customerInformation.personalInformation.lastName}, 'Admin.Orderscustomers.Feature') }}
        </p>
        <a class="btn btn-primary" href="{{ getAdminLink('AdminCartRules', true, {addcart_rule: 1, back: app.request.uri}) }}">
          <i class="material-icons">add_circle</i>
          {{ 'Create voucher'|trans({}, 'Admin.Global') }}
        </a>
      </div>
    {% endif %}
  </div>
</div>
