<?php

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

?>
<div class="app-details-container">
  <section>
    <?php
    $breadcrumbs = [
      ['label' => t('Home'), 'path' => 'admin'],
      ['label' => t('Tenants'), 'path' => 'admin/tenants'],
      ['label' => t('Create tenant')],
    ];
    require templatePath('partials/app-breadcrumb.phtml');
    $titlebar = [
      'title' => t('Create tenant'),
      'backHref' => 'admin/tenants',
      'backTitle' => t('Cancel'),
      'actions' => [
        [
          'form' => 'tenant-form',
          'name' => 'action',
          'value' => 'create',
          'class' => 'secondary outline',
          'label' => t('Create'),
        ],
        [
          'form' => 'tenant-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;
    $showCustomFieldsTab = (bool) ($canManageCustomFields ?? false);
    $showSsoTab = (bool) ($canManageSso ?? false);
    $customFieldTenantUuid = '';
    $customFieldDefinitions = [];
    require __DIR__ . '/_form.phtml';
    ?>
  </section>
</div>
