<?php

/**
 * @var int     $total
 * @var array[] $list
 */

$this->layout('system::layout/default');
?>

<?php if ($total) : ?>
    <?php foreach ($list as $comment) : ?>
        <div class="new_post-item without_avatar">
            <a href="/library/article/<?= $comment['id'] ?>/comments" class="card-title h3"><?= $this->e($comment['name']) ?></a>
            <div class="post-body"><?= $comment['text'] ?></div>
            <div class="me-2 post-meta">
                <span><?= __('Author:') ?></span><?= $comment['who'] ?>
            </div>
        </div>
    <?php endforeach; ?>
<?php else : ?>
    <div class="row">
        <div class="col-md-6">
            <div class="alert alert-info"><?= __('The list is empty') ?></div>
        </div>
    </div>
<?php endif; ?>
<div class="mt-3">
    <a href="/library/"><?= __('Back') ?></a>
</div>
