<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Contracts\UserInterface;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Tree;

/**
 * @var string        $base_url
 * @var string        $comments
 * @var Tree|null     $tree
 * @var UserInterface $user
 */

?>
<div dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
    <p>
        <?= I18N::translate('Hello administrator…') ?>
    </p>

    <p>
        <?= /* I18N: %s is a server name/URL */
        I18N::translate('A prospective user has registered with webtrees at %s.', e($base_url)) ?>
    </p>

    <dl>
        <dt><?= I18N::translate('Username') ?></dt>
        <dd><?= e($user->userName()) ?></dd>
        <dt><?= I18N::translate('Real name') ?></dt>
        <dd><?= e($user->realName()) ?></dd>
        <dt><?= I18N::translate('Email address') ?></dt>
        <dd><?= e($user->email()) ?></dd>
        <dt><?= I18N::translate('Comments') ?></dt>
        <dd><?= e($comments) ?></dd>
        <dt><?= I18N::translate('Tree') ?></dt>
        <dd><?= e($tree ? $tree->name() : '') ?></dd>
    </dl>

    <p>
        <?= I18N::translate('The user has been sent an email with the information necessary to confirm the access request.') ?>
    </p>

    <p>
        <?= I18N::translate('You will be informed by email when this prospective user has confirmed the request. You can then complete the process by activating the username. The new user will not be able to sign in until you activate the account.') ?>
    </p>
</div>
