<?= $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>Alter Name</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/nick/{$character['name']}") ?>" method="post">
                    <?= __csrf(); ?>
                    <div class="fields">
                        <div class="fieldGroup">
                            <span>New name *</span>
                            <input type="text" name="newnick" required autocomplete="off">
                        </div>
                    </div>

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