<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
use Fisharebest\Webtrees\Http\RequestHandlers\UserListData;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\View;

/**
 * @var string $filter
 * @var string $title
 */

?>

<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>

<h1><?= $title ?></h1>

<table
    id="wt-datatables-admin-users"
    class="table table-sm table-bordered table-user-list datatables"
    <?= view('lists/datatables-attributes') ?>
    data-processing="true"
    data-server-side="true"
    data-ajax='{"url":"<?= e(route(UserListData::class)) ?>"}'
    data-auto-width="false"
    data-sorting='[[2,"asc"]]'
    data-search='{"search":"<?= e($filter) ?>"}'
    data-columns='[{"sortable":false},{"visible":false},{},{},{},{},{"visible":false},{"dataSort":6},{"visible":false},{"dataSort":8},{},{}]'
>
    <thead>
        <tr>
            <th><?= I18N::translate('Edit') ?></th>
            <th><!-- user id --></th>
            <th><?= I18N::translate('Username') ?></th>
            <th><?= I18N::translate('Real name') ?></th>
            <th><?= I18N::translate('Email address') ?></th>
            <th><?= I18N::translate('Language') ?></th>
            <th><!-- date registered --></th>
            <th><?= I18N::translate('Date registered') ?></th>
            <th><!-- last login --></th>
            <th><?= I18N::translate('Last signed in') ?></th>
            <th><?= I18N::translate('Verified') ?></th>
            <th><?= I18N::translate('Approved') ?></th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>
