<?php

declare(strict_types=1);

use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Illuminate\Support\Collection;

/**
 * @var Collection<int,object{title:string,individual:Individual}> $stories
 * @var string                 $title
 */

?>

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

<table class="table table-bordered w-100">
    <thead>
        <tr>
            <th><?= I18N::translate('Story title') ?></th>
            <th><?= I18N::translate('Individual') ?></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($stories as $story) : ?>
            <tr>
                <td>
                    <?= e($story->title) ?>
                </td>
                <td>
                    <a href="<?= e($story->individual->url()) ?>#tab-stories">
                        <?= $story->individual->fullName() ?>
                    </a>
                </td>
            </tr>
        <?php endforeach ?>
    </tbody>
</table>
