<?php

/**
 * @var array<int, string> $errors
 * @var array $form
 */

?>
<div class="app-details-container">
  <section>
    <?php
    $breadcrumbs = [
      ['label' => t('Home'), 'path' => 'admin'],
      ['label' => t('Permissions'), 'path' => 'admin/permissions'],
      ['label' => t('Create permission')],
    ];
    require templatePath('partials/app-breadcrumb.phtml');
    $titlebar = [
      'title' => t('Create permission'),
      'backHref' => 'admin/permissions',
      'backTitle' => t('Cancel'),
      'actions' => [
        [
          'form' => 'permission-form',
          'name' => 'action',
          'value' => 'create',
          'class' => 'secondary outline',
          'label' => t('Create'),
        ],
        [
          'form' => 'permission-form',
          'name' => 'action',
          'value' => 'create_close',
          'class' => 'primary',
          'label' => t('Create & close'),
        ],
      ],
    ];
    require templatePath('partials/app-details-titlebar.phtml');
    ?>
    <?php
    $validationSummaryErrors = $validationSummaryErrors ?? ($errors ?? []);
    require templatePath('partials/app-details-validation-summary.phtml');
    ?>
    <?php
    $values = $form ?? [];
    $detailsOpenAll = true;
    require __DIR__ . '/_form.phtml';
    ?>
  </section>
</div>
