{#**
 * Copyright since 2025 InPost S.A.
 *
 * For the full license information, please view the LICENSE file bundled with the module.
 *
 * @author InPost S.A.
 * @copyright since 2025 InPost S.A.
 * @license MIT
 *#}
<div class="tab tab-pane inpost-international-theme" id="inpost_intl_shipments">
  <div class="card card-details mb-0">
    <div class="card-header d-none d-print-block">
      {{ 'InPost International'|trans({}, 'Modules.Inpostinternational.Admin') }}
    </div>

    <div class="card-body">
      {% embed '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' %}
        {% block grid_view_block %}
          {{ include('@Modules/inpostinternational/views/templates/admin/components/_simple_grid.html.twig')}}
        {% endblock %}

        {% block grid_panel_footer %}
          <div class="card-footer text-right d-print-none">
            <a class="btn btn-outline-secondary" href="{{ url('admin_inpost_intl_shipments_index') }}">
              {{ 'Go to all shipments list'|trans({}, 'Modules.Inpostinternational.Order') }}
            </a>

            {% if can_create %}
              <a href="{{ path('admin_inpost_intl_orders_create_shipment', {'orderId': order_id}) }}" class="btn btn-primary">
                {{ 'New shipment'|trans({}, 'Modules.Inpostinternational.Order') }}
              </a>

{#              <button#}
{#                type="button"#}
{#                class="btn btn-primary js-inpost-intl-create-shipment"#}
{#                data-url="{{ path('admin_inpost_intl_orders_create_shipment', {'orderId': order_id}) }}"#}
{#                data-modal-title="{{ 'Create new shipment'|trans({}, 'Modules.Inpostinternational.Order') }}"#}
{#              >#}
{#                {{ 'New shipment'|trans({}, 'Modules.Inpostinternational.Order') }}#}
{#              </button>#}

              <script src="{{ asset('js/admin/order/view.js', 'InPostInternational') }}"></script>
            {% endif %}
          </div>
        {% endblock %}
      {% endembed %}
    </div>
  </div>

  {% embed '@PrestaShop/Admin/Helpers/bootstrap_popup.html.twig' with {
    'id': 'inpost_intl_parcel_tracking_details_modal',
    'title': 'Parcel tracking details'|trans({}, 'Modules.Inpostinternational.Shipment'),
    'closable': true,
  } %}
    {% block content %}
      <div class="modal-body js-inpost-intl-parcel-tracking-details-wrapper"></div>
    {% endblock %}
  {% endembed %}
</div>
