<?php

declare(strict_types=1);

use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Module\ModuleBlockInterface;
use Fisharebest\Webtrees\Tree;

/**
 * @var ModuleBlockInterface $block
 * @var int                  $block_id
 * @var string               $cancel_url
 * @var string               $save_url
 * @var string               $title
 * @var Tree                 $tree
 */

?>

<h2 class="wt-page-title">
    <?= $title ?>
</h2>

<p>
    <?= $block->description() ?>
</p>

<form method="post" action="<?= e($save_url) ?>">
    <?= $block->editBlockConfiguration($tree, $block_id) ?>

    <div class="row mb-3">
        <div class="offset-sm-3 col-sm-9">
            <button type="submit" class="btn btn-primary">
                <?= view('icons/save') ?>
                <?= I18N::translate('save') ?>
            </button>
            <a class="btn btn-secondary" href="<?= e($cancel_url) ?>">
                <?= view('icons/cancel') ?>
                <?= I18N::translate('cancel') ?>
            </a>
        </div>
    </div>

    <?= csrf_field() ?>
</form>
