<?php

/**
 * Shared danger-zone delete field.
 *
 * @var string $dangerFormId
 * @var string $dangerLegend
 * @var string $dangerWarning
 * @var string $dangerButtonLabel
 */

$dangerFormId = (string) ($dangerFormId ?? '');
$dangerLegend = (string) ($dangerLegend ?? t('Delete'));
$dangerWarning = (string) ($dangerWarning ?? t('This action cannot be undone.'));
$dangerButtonLabel = (string) ($dangerButtonLabel ?? t('Delete'));

if ($dangerFormId === '') {
  return;
}

?>
<blockquote data-variant="error">
  <p><i class="bi bi-exclamation-diamond-fill"></i> <?php e(t('This action cannot be undone.')); ?></p>
</blockquote>
<fieldset>
  <legend><small><?php e($dangerLegend); ?></small></legend>
  <p class="muted"><?php e($dangerWarning); ?></p>
  <button type="submit" class="danger" form="<?php e($dangerFormId); ?>" data-detail-action-kind="delete">
    <?php e($dangerButtonLabel); ?>
  </button>
</fieldset>
