<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Fact;

/**
 * @var Fact $fact
 */

?>

<?php if (preg_match_all('/\n(2 NOTE\b.*(?:\n[^2].*)*)/', $fact->gedcom(), $matches, PREG_SET_ORDER) > 0) : ?>
    <div class="wt-fact-notes mt-2">
        <?php foreach ($matches as $match) : ?>
            <?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag(), 'tree' => $fact->record()->tree()]) ?>
        <?php endforeach ?>
    </div>
<?php endif ?>
