<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Http\RequestHandlers\CreateNoteAction;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Tree;

/**
 * @var Tree $tree
 */

?>

<form method="post" action="<?= e(route(CreateNoteAction::class, ['tree' => $tree->name()])) ?>" id="wt-modal-form">
    <?= view('modals/header', ['title' => I18N::translate('Create a shared note')]) ?>

    <div class="modal-body">
        <?= view('modals/note-object-fields') ?>
    </div>

    <?= view('modals/footer-save-cancel') ?>

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

<script>
  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
</script>
