<?php

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">
    <?= csrf_field() ?>

    <?= view('modals/header', ['title' => I18N::translate('Link this media object to an individual')]) ?>

    <div class="modal-body">
        <div class="form-group">
            <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') ?>
</form>
