<?php require APPROOT . '/app/views/components/header.php'; ?>

<!-- Article container begin -->
<div class="container article-container">
    <div class="article-content">
        <!-- <h3>Article</h3> -->



        <!-- article post end -->

        <!-- All post section begins -->

        <div class="all-posts">
            <div class="container mt-4">
                <div class="row">
                    <?php if (!empty($data['article'])) : ?>
                    <div class="col-md-12">
                        <div class=" shadow-sm articles" data-aos="fade-up" data-aos-duration="1000">
                            <div class="card-body articles-content">
                                <div class="article-image">
                                    <img src="<?= URLROOT?>/images/article-image/rise-of-ai.jpg" alt="image">
                                </div>
                                <div class="article-contents">
                                    <h2><?= htmlspecialchars($data['article']->title) ?></h2>
                                    <span class="text-muted">
                                        Posted By: <?= htmlspecialchars($data['article']->name) ?>
                                    </span><br>
                                    <span class="text-muted">
                                        <?= date('F j, Y', strtotime($data['article']->createdAt)) ?>
                                    </span><br><br>

                                    <p style="font-size: 16px;">
                                        <?= htmlspecialchars($data['article']->body) ?></p>
                                </div>

                            </div>
                        </div>
                    </div>
                    <?php else : ?>
                    <p>Article not found.</p>
                    <?php endif; ?>


                </div>
            </div>
        </div>

    </div>
</div>



<!-- footer -->
<?php require APPROOT . '/app/views/components/footer.php'; ?>