<?php

declare(strict_types=1);

use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Statistics;

/** @var Statistics $stats */
?>

<h4 class="border-bottom p-2 mb-4">
    <?= I18N::translate('Places') ?>
    <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalPlaces() ?></span>
</h4>

<div class="row row-cols-1 row-cols-md-2 g-3 mb-3">
    <div class="col">
        <div class="card">
            <h5 class="card-header">
                <?= I18N::translate('Birth places') ?>
            </h5>
            <?= $stats->commonBirthPlacesList() ?>
        </div>
    </div>

    <div class="col">
        <div class="card">
            <h5 class="card-header">
                <?= I18N::translate('Death places') ?>
            </h5>
            <?= $stats->commonDeathPlacesList() ?>
        </div>
    </div>

    <div class="col">
        <div class="card">
            <h5 class="card-header">
                <?= I18N::translate('Marriage places') ?>
            </h5>
            <?= $stats->commonMarriagePlacesList() ?>
        </div>
    </div>

    <div class="col">
        <div class="card">
            <h5 class="card-header">
                <?= I18N::translate('Events in countries') ?>
            </h5>
            <?php $result = $stats->commonCountriesList(); ?>
            <?php if ($result) : ?>
                <?= $result ?>
            <?php else : ?>
                <div class="card-body">
                    <?= I18N::translate('This information is not available.') ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>
