<?php require dirname(__DIR__) . '/layouts/app.php'; ?>

<section class="page-heading">
    <div>
        <p class="eyebrow">Notifications</p>
        <h1>Nouvelle alerte importante</h1>
    </div>
    <a class="button-link secondary" href="<?= url('/notifications') ?>">Retour</a>
</section>

<?php if (!empty($errors)): ?>
    <div class="alert alert-error">
        <?php foreach ($errors as $error): ?>
            <div><?= e($error) ?></div>
        <?php endforeach; ?>
    </div>
<?php endif; ?>

<form class="form-panel" method="post" action="<?= url('/notifications/store-alert') ?>">
    <input type="hidden" name="_token" value="<?= csrf_token() ?>">

    <div class="form-grid">
        <label>
            Titre
            <input type="text" name="title" required>
        </label>
    </div>

    <label class="full-field">
        Message
        <textarea name="message" rows="5" required></textarea>
    </label>

    <div class="form-actions">
        <button type="submit">Publier l'alerte</button>
    </div>
</form>

<?php require dirname(__DIR__) . '/layouts/app_footer.php'; ?>
