<?= $this->layout('_layout', ['title' => $title]); ?>

<main class="main">
    <?= $this->insert('includes/aside_info') ?>
    <div class="content">
        <div class="h2-title h2-title-content flex-s-c">
            <span>My Account</span>
        </div>

        <?= $this->insert('user/_user'); ?>
        <br>

        <div class="h2-title h2-title-content flex-s-c">
            <span>Move Character</span>
        </div>

        <div class="_links">
            <a class="button" href="<?= __redirect("user/manage/character/{$character['name']}") ?>">To go back</a>
        </div>


        <div class="p-2 bg-neutral-200 mt-16">
            <?php if ($active) : ?>
                <form action="<?= __redirect("auth/manage/move/{$character['name']}") ?>" method="post">
                    <?= __csrf(); ?>
                    <div class="fields">
                        <div class="fieldGroup">
                            <span>Select move</span>
                            <select name="move" required>
                                <option value="" selected> -- Selecione o move</option>
                                <?php foreach (maps as $key => $move) : ?>
                                    <option value="<?= $key ?>"><?= $move['name'] ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>

                    <button type="submit"> Alterar</button>
                </form>
            <?php else : ?>
                <div class="warning">Funcionalidade indisponível no momento</div>
            <?php endif; ?>
        </div>
    </div>
</main>