<h2 class="mb-4"><i class="bi bi-pencil"></i> Map hernoemen</h2>

<form method="post" class="card shadow-sm">
    <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrf) ?>">

    <div class="card-body">
        <div class="mb-3">
            <label class="form-label text-muted">Huidige mapnaam</label>
            <p class="form-control-plaintext fw-bold"><?= htmlspecialchars(basename($fullPath)) ?></p>
        </div>
        <div class="mb-3">
            <label for="new_name" class="form-label">Nieuwe naam</label>
            <input type="text" class="form-control" id="new_name" name="new_name"
                   value="<?= htmlspecialchars(basename($fullPath)) ?>" required autofocus>
            <div class="form-text">Alleen letters, cijfers, punten, underscores en streepjes.</div>
        </div>
        <?php if (!empty($message)): ?>
            <div class="alert alert-<?= $messageType ?>"><?= htmlspecialchars($message) ?></div>
        <?php endif; ?>
    </div>

    <div class="card-footer text-end">
        <a href="/admin/content&dir=<?= urlencode(dirname($dir) === '.' ? '' : dirname($dir)) ?>" class="btn btn-secondary">Annuleren</a>
        <button type="submit" class="btn btn-primary"><i class="bi bi-check-lg"></i> Opslaan</button>
    </div>
</form>
