<?php

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

?>
<div class="app-details-container">
  <section>
    <?php
    $titlebar = [
      'title' => t('Create role'),
      'backHref' => 'admin/roles',
      'backTitle' => t('Cancel'),
      'actions' => [
        [
          'form' => 'role-form',
          'name' => 'action',
          'value' => 'create',
          'class' => 'secondary outline',
          'label' => t('Create'),
        ],
        [
          'form' => 'role-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 if (!empty($warnings)): ?>
      <div class="notice" data-variant="info">
        <ul>
          <?php foreach ($warnings as $warning): ?>
            <li><?php e($warning); ?></li>
          <?php endforeach; ?>
        </ul>
      </div>
    <?php endif; ?>
    <?php
    $values = $form ?? [];
    $detailsOpenAll = true;
    $ignoreTabStorage = true;
    require __DIR__ . '/_form.phtml';
    ?>
  </section>
</div>
