<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Place;
use Fisharebest\Webtrees\I18N;

/**
 * @var string $edit_url
 * @var Place  $place
 * @var string $latitude
 * @var string $longitude
 * @var bool   $showlink
 */
?>
<div dir="auto" class="label">
    <?php if ($showlink) : ?>
        <a href="<?= e($place->url()) ?>">
            <?= $place->placeName() ?>
        </a>
    <?php else : ?>
        <?= $place->placeName() ?>
    <?php endif ?>

    <?php if ($edit_url !== '') : ?>
        <a href="<?= e($edit_url) ?>"><?= view('icons/edit') ?></a>
    <?php endif ?>

    <table class="table table-borderless">
        <tr>
            <th scope="row" class="p-0"><?= I18N::translate('Latitude') ?></th>
            <td class="p-0 align-digits"><?= $latitude ?></td>
        </tr>
        <tr>
            <th scope="row" class="p-0"><?= I18N::translate('Longitude') ?></th>
            <td class="p-0 align-digits"><?= $longitude ?></td>
        </tr>
    </table>
</div>
