<?php if ($active == 0) : ?>
    <br>
    <div class="h2-title h2-title-content flex-s-c">
        <span>Comments</span>
    </div>
    <div>
        <?php if (!empty($comments)) : foreach ($comments as $comment) : ?>
                <div class="information">
                    <h1>
                        <?= $comment['message'] ?>
                    </h1>
                    <p class="page-date">Commented by: <?= ucfirst($comment['author']) ?> | <?= $comment['date'] ?> </p>
                </div>
            <?php endforeach;
        else : ?>
            <p class="warning">There are no comments at the moment</p>
        <?php endif; ?>
    </div>
    <br>
    <div>
        <form action="<?= __redirect("comment/notice/{$id_notice}") ?>" method="post">
            <?= __csrf(); ?>
            <div class="fields">
                <div class="fieldGroup">
                    <span>Message <sup>*</sup></span>
                    <textarea cols="30" rows="4" name="message" required minlength="10" maxlength="1000" placeholder="Type your answer here"></textarea>
                </div>
            </div>

            <button type="submit">Send</button>
        </form>
    </div>
<?php else : ?>
    <p class="warning">Comments disabled</p>
<?php endif; ?>