<% packages.forEach((item) => {
  const id = String(item._id || item.id || '');
  const active = item.presentation.active;
  const name = item.name?.[lang] || item.name?.ar || item.name?.en || '—';
  const description = item.description?.[lang] || item.description?.ar || item.description?.en || '';
%>
  <article class="cc-row" id="tr<%= id %>" data-cc-id="<%= id %>">
    <div class="cc-row__identity">
      <span class="cc-avatar"><i class="ti ti-brain" aria-hidden="true"></i></span>
      <div class="cc-row__copy">
        <span class="cc-row__kicker"><%= item.flagetext?.[lang] || i18n.__('catalogCommerce.aiPricingPackage') %></span>
        <h2><%= name %></h2>
        <p><%= description || '—' %></p>
        <% if (Array.isArray(item.features) && item.features.length) { %>
          <div class="cc-chips"><span class="cc-chip"><i class="ti ti-list-check"></i><%= item.features.length %> <%= i18n.__('catalogCommerce.features') %></span></div>
        <% } %>
      </div>
    </div>
    <div class="cc-row__facts">
      <span class="cc-fact"><small><%= i18n.__('packages.price') %></small><strong><%= item.isFree ? i18n.__('packages.isFree') : `${item.price} ${i18n.__('common.currency')}` %></strong></span>
      <span class="cc-fact"><small><%= i18n.__('packages.duration') %></small><strong><%= item.duration %> <%= i18n.__(`packages.${item.type}`) %></strong></span>
      <span class="cc-fact"><small><%= i18n.__('common.status') %></small><strong><span class="cc-status cc-status--<%= active ? 'active' : 'inactive' %>"><%= active ? i18n.__('common.active') : i18n.__('common.inActive') %></span></strong></span>
      <span class="cc-fact"><small><%= i18n.__('packages.maxParticipants') %></small><strong><%= item.maxParticipants || '—' %></strong></span>
      <span class="cc-fact"><small><%= i18n.__('common.date') %></small><strong><%= item.createdAt ? moment(item.createdAt).locale(lang).format('YYYY/MM/DD') : '—' %></strong></span>
      <span class="cc-fact"><small><%= i18n.__('packages.packageUserType') %></small><strong><%= i18n.__('packages.provider') %></strong></span>
    </div>
    <div class="cc-row__actions">
      <a class="cc-action" href="/dashboard/packages/show/<%= id %>" title="<%= i18n.__('common.show') %>"><i class="ti ti-eye"></i></a>
      <a class="cc-action" href="/dashboard/packages/edit/<%= id %>" title="<%= i18n.__('common.edit') %>"><i class="ti ti-edit"></i></a>
      <button class="cc-action cc-action--danger" type="button" data-cc-action="delete" data-method="DELETE"
        data-id="<%= id %>" data-url="/dashboard/packages/delete"
        data-confirm-message="<%= i18n.__('packages.packageUsage') %>"
        title="<%= i18n.__('common.delete') %>"><i class="ti ti-trash"></i></button>
    </div>
  </article>
<% }) %>
