<?= $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 Characters</span>
        </div>

        <div>
            <ul class="_links">
                <li><a class="button" href="<?= __redirect("market/view/characters") ?>">Ads</a></li>
                <li><a class="button" href="<?= __redirect("market/store/characters") ?>">My ads</a></li>
            </ul>
        </div>

        <div class="flex-c-c gap-10 my-characters-market">
            <?php if ($characters) : foreach ($characters as $char) : ?>
                    <div>
                        <div>
                            <img src="<?= __avatar($char->image) ?>" width="100" height="100">
                        </div>
                        <div><?= $char->name ?></div>
                        <div class="flex-c-c gap-5">
                            <div class="information">
                                <div class="info"> Resets: <span><?= $char->resets ?></span></div>
                                <div class="info"> MResets: <span><?= $char->mresets ?></span></div>
                                <div class="info"> Killer: <span><?= $char->killer ?></span></div>
                                <div class="info"> Hero: <span><?= $char->hero ?></span></div>
                            </div>
                            <div class="information">
                                <div class="info"> Strength: <span><?= $char->strength ?></span></div>
                                <div class="info"> Dexterity: <span><?= $char->dexterity ?></span></div>
                                <div class="info"> Vitality: <span><?= $char->vitality ?></span></div>
                                <div class="info"> Energy: <span><?= $char->energy ?></span></div>
                            </div>
                        </div>
                        <br>
                        <a href="<?= __redirect("market/advertise/character/{$char->name}") ?>" class="button">Anunciar</a>
                    </div>
                <?php endforeach;
            else : ?>
                <div class="warning">There is no character created at this time</div>
            <?php endif; ?>

        </div>
    </div>