<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToRecordAction;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Media;
use Fisharebest\Webtrees\Tree;

/**
 * @var Media $media
 * @var Tree $tree
 */

?>

<form method="post" action="<?= e(route(LinkMediaToRecordAction::class, ['tree' => $tree->name(), 'xref' => $media->xref()])) ?>" id="wt-modal-form">
    <?= view('modals/header', ['title' => I18N::translate('Link this media object to an individual')]) ?>

    <div class="modal-body">
        <div class="mb-3">
            <label class="col-form-label" for="link">
                <?= I18N::translate('Individual') ?>
            </label>
            <?= view('components/select-individual', ['name' => 'link', 'tree' => $tree]) ?>
        </div>
    </div>

    <?= view('modals/footer-save-cancel') ?>

    <?= csrf_field() ?>
</form>
