<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>

<div class="container mt-4">
  <h3>Competition Winners</h3>
  <p class="text-muted">
    Published competition winner announcements
    <?php if (!empty($schoolYear)): ?>
      for <?= esc($schoolYear) ?>
    <?php endif; ?>.
  </p>

  <div class="list-group">
    <?php foreach ($competitions as $c): ?>
      <a class="list-group-item list-group-item-action"
         href="/winners/competitions/<?= $c['id'] ?>">
        <div class="d-flex justify-content-between">
          <div>
            <strong><?= esc($c['title']) ?></strong>
          </div>
          <small class="text-muted"><?= esc($c['published_at'] ?? '') ?></small>
        </div>
      </a>
    <?php endforeach; ?>

    <?php if (empty($competitions)): ?>
      <div class="alert alert-info">No winners published yet.</div>
    <?php endif; ?>
  </div>
</div>

<?= $this->endSection() ?>
