<?php use function App\Core\{e, url}; $mods = $mods ?? []; $section = $section ?? 'modlarim'; ?>
<div class="panel creator-shell">
    <?php require BASE_PATH . '/app/Views/partials/studio-sidebar.php'; ?>
    <section class="panel-body studio-list-page">
        <div class="studio-section-head">
            <div>
                <p class="eyebrow">Studio</p>
                <h1>Modlarim</h1>
                <p>Yayin, taslak ve inceleme durumundaki mod kayitlari.</p>
            </div>
            <a class="pill primary" href="<?= url('/studyo/mod-yukle') ?>">Mod Yukle</a>
        </div>
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>Mod</th>
                        <th>Kategori</th>
                        <th>Durum</th>
                        <th>Gizlilik</th>
                        <th>Shield</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                <?php if ($mods === []): ?>
                    <tr><td colspan="6">Henuz mod yok.</td></tr>
                <?php endif; ?>
                <?php foreach ($mods as $mod): ?>
                    <tr>
                        <td><?= e($mod['title'] ?? 'Mod') ?></td>
                        <td><?= e($mod['category_name'] ?? '-') ?></td>
                        <td><span class="status-pill"><?= e($mod['status'] ?? 'draft') ?></span></td>
                        <td><?= e($mod['privacy'] ?? 'public') ?></td>
                        <td><?= e($mod['external_link_status'] ?? 'unchecked') ?></td>
                        <td><a class="pill" href="<?= url('/studyo/mod-duzenle/' . (int) $mod['id']) ?>">Duzenle</a></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        </div>
    </section>
</div>
