<%- include('../catalogCommerce/assets.ejs') %>
<%
  const departmentTotal = typeof totalCount !== 'undefined' ? totalCount : departments.length;
%>
<main class="cc-console" data-cc-console data-module="departments"
  data-filter-url="/dashboard/departments/filter" data-csrf="<%= typeof csrfToken !== 'undefined' ? csrfToken : '' %>">
  <%- include('../catalogCommerce/header.ejs', {
    title: i18n.__('departments.departments'),
    subtitle: i18n.__('catalogCommerce.departmentsSubtitle'),
    icon: 'ti-layout-grid',
    count: departmentTotal,
    createUrl: '/dashboard/departments/create',
    hasFilters: true,
    tabs: [],
    secondaryLinks: []
  }) %>
  <%- include('../catalogCommerce/filters.ejs', { filterData, lang, i18n }) %>
  <p class="cc-error" data-cc-error hidden></p>
  <section class="cc-results-shell">
    <div class="cc-results-shell__bar">
      <strong><%= i18n.__('catalogCommerce.departmentsRegistry') %></strong>
      <span><%= i18n.__('catalogCommerce.departmentsRegistryDescription') %></span>
    </div>
    <div data-cc-results><%- include('./dataTable.ejs', { departments, paginationHtml, lang, i18n, moment }) %></div>
  </section>
  <%- include('../catalogCommerce/confirmModal.ejs', { lang }) %>
</main>
