<?php use function App\Core\{e, url}; $tracks = $tracks ?? []; $section = $section ?? 'muziklerim'; ?>
<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>Muziklerim</h1>
                <p>Yuklenen audio kayitlari, kapaklar ve premium erisim durumlari.</p>
            </div>
            <a class="pill primary" href="<?= url('/studyo/muzik-yukle') ?>">Muzik Yukle</a>
        </div>
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>Sarki</th>
                        <th>Sanatci</th>
                        <th>Tur</th>
                        <th>Durum</th>
                        <th>Audio</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                <?php if ($tracks === []): ?>
                    <tr><td colspan="6">Henuz muzik yok.</td></tr>
                <?php endif; ?>
                <?php foreach ($tracks as $track): ?>
                    <tr>
                        <td><?= e($track['title'] ?? 'Sarki') ?></td>
                        <td><?= e($track['artist_name'] ?? '-') ?></td>
                        <td><?= e($track['category_name'] ?? '-') ?></td>
                        <td><span class="status-pill"><?= e($track['status'] ?? 'draft') ?></span></td>
                        <td><?= !empty($track['audio_file']) ? 'Var' : 'Yok' ?></td>
                        <td><a class="pill" href="<?= url('/studyo/muzik-duzenle/' . (int) $track['id']) ?>">Duzenle</a></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        </div>
    </section>
</div>
