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

<section class="panel narrow">
    <p class="eyebrow">Suporte</p>
    <h1>Novo ticket</h1>
    <p>Descreva o problema com detalhes. Se for pagamento, anexe o comprovativo ou imagem do erro.</p>

    <form class="form" method="post" action="/support/store" enctype="multipart/form-data">
        <?= csrf_field() ?>
        <label>Assunto
            <input name="subject" maxlength="140" placeholder="Ex: Pagamento enviado mas curso nao liberou" required>
        </label>
        <div class="grid two">
            <label>Categoria
                <select name="category" required>
                    <?php foreach ($categories as $value => $label): ?>
                        <option value="<?= e($value) ?>"><?= e($label) ?></option>
                    <?php endforeach; ?>
                </select>
            </label>
            <label>Prioridade
                <select name="priority">
                    <option value="normal">Normal</option>
                    <option value="high">Alta</option>
                    <option value="urgent">Urgente</option>
                    <option value="low">Baixa</option>
                </select>
            </label>
        </div>
        <label>Mensagem
            <textarea name="message" rows="7" placeholder="Explique o que aconteceu, em que curso/pagamento, e o que esperava que acontecesse." required></textarea>
        </label>
        <label>Anexo opcional
            <input name="attachment" type="file" accept=".pdf,.jpg,.jpeg,.png">
            <span class="muted">PDF, JPG ou PNG ate 8MB.</span>
        </label>
        <div class="row-actions">
            <button class="button" type="submit">Enviar ticket</button>
            <a class="ghost-button" href="/support">Voltar</a>
        </div>
    </form>
</section>

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