<?php use function App\Core\e; $section = 'dosya-yoneticisi'; ?>
<div class="panel zpanel zpanel-app">
    <?php require BASE_PATH . '/app/Views/zpanel/_sidebar.php'; ?>
    <section class="panel-body zpanel-main">
        <div class="zpanel-head"><div><p class="eyebrow">ZPanel</p><h1>Dosya Yoneticisi</h1><p class="muted">Sadece <code>public/uploads</code> altini listeler. Silme islemi TODO.</p></div></div>
        <section class="zpanel-card">
            <div class="zpanel-card-head"><h2>/uploads/<?= e($currentDir ?? '') ?></h2><a href="/zpanel/dosya-yoneticisi">Kok</a></div>
            <div class="table-scroll"><table class="zpanel-table"><thead><tr><th>Ad</th><th>Tur</th><th>Boyut</th><th>Tarih</th><th>Link</th></tr></thead><tbody>
            <?php foreach (($items ?? []) as $item): ?><tr><td><?php if (($item['type'] ?? '') === 'folder'): ?><a href="/zpanel/dosya-yoneticisi?dir=<?= e($item['relative'] ?? '') ?>"><?= e($item['name'] ?? '') ?></a><?php else: ?><?= e($item['name'] ?? '') ?><?php endif; ?><?= !empty($item['is_php']) ? '<span class="status-pill">php dikkat</span>' : '' ?></td><td><?= e($item['type'] ?? '') ?></td><td><?= isset($item['size']) ? e(number_format((float) $item['size'] / 1024, 1, ',', '.') . ' KB') : '-' ?></td><td><?= e($item['modified_at'] ?? '') ?></td><td><?php if (!empty($item['view_url'])): ?><a href="<?= e($item['view_url']) ?>" target="_blank" rel="noopener">Goruntule</a><?php else: ?>-<?php endif; ?></td></tr><?php endforeach; ?>
            <?php if (empty($items)): ?><tr><td colspan="5">Dosya yok.</td></tr><?php endif; ?>
            </tbody></table></div>
        </section>
    </section>
</div>
