<section class="card">
  <h2 class="section-title"><?= $e($t('users.title')) ?></h2>
  <p class="muted mt-12"><?= $e($t('users.description')) ?></p>
</section>

<section class="card mt-16">
  <h2 class="section-title"><?= $e($t('users.create_title')) ?></h2>

  <?php if (!empty($errorMessage)): ?>
    <div class="alert alert--danger mt-12" role="alert">
      <?= $e($errorMessage) ?>
    </div>
  <?php endif; ?>

  <?php if (!empty($successMessage)): ?>
    <div class="alert alert--success mt-12" role="status">
      <?= $e($successMessage) ?>
    </div>
  <?php endif; ?>

  <form class="users-form mt-16" action="/settings/users" method="post" novalidate>
    <input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">

    <label class="form-field">
      <span class="field-label"><?= $e($t('users.fields.name')) ?></span>
      <input class="form-control" type="text" name="name" required value="<?= $e($oldName ?? '') ?>">
    </label>

    <label class="form-field">
      <span class="field-label"><?= $e($t('users.fields.email')) ?></span>
      <input class="form-control" type="email" name="email" required value="<?= $e($oldEmail ?? '') ?>">
    </label>

    <label class="form-field">
      <span class="field-label"><?= $e($t('users.fields.password')) ?></span>
      <input class="form-control" type="password" name="password" required>
    </label>

    <button type="submit" class="btn btn--primary"><?= $e($t('users.actions.add_user')) ?></button>
  </form>
</section>

<?php require __DIR__ . '/../components/table-list.php'; ?>
