<?php include app()->basePath('app/Views/partials/header.php'); ?>

<section class="panel narrow">
    <p class="eyebrow">Perfil</p>
    <h1>Dados da conta</h1>
    <form method="post" action="/profile" class="form">
        <?= csrf_field() ?>
        <label>
            Nome
            <input name="name" value="<?= e($user['name']) ?>" required>
        </label>
        <label>
            Email
            <input value="<?= e($user['email']) ?>" disabled>
        </label>
        <label>
            Telefone
            <input name="phone" value="<?= e($user['phone'] ?? '') ?>">
        </label>
        <div class="grid two">
            <label>
                Provincia
                <input name="province" value="<?= e($user['profile']['province'] ?? '') ?>">
            </label>
            <label>
                Cidade
                <input name="city" value="<?= e($user['profile']['city'] ?? '') ?>">
            </label>
        </div>
        <label>
            Bio
            <textarea name="bio" rows="4"><?= e($user['profile']['bio'] ?? '') ?></textarea>
        </label>
        <button class="button" type="submit">Guardar perfil</button>
    </form>
</section>

<?php include app()->basePath('app/Views/partials/footer.php'); ?>
