<?php
use App\Core\Lang;
use function App\Core\e;

$currentLang = Lang::current();
$languages = [
    'tr' => ['badge' => 'TR', 'label' => 'T&uuml;rk&ccedil;e'],
    'en' => ['badge' => 'GB', 'label' => 'English'],
    'de' => ['badge' => 'DE', 'label' => 'Deutsch'],
    'fr' => ['badge' => 'FR', 'label' => 'Fran&ccedil;ais'],
];
?>
<div class="dropdown-section account-preferences">
    <div class="dropdown-label">Dil</div>
    <form class="language-chips" data-lang-form>
        <input type="hidden" name="lang" value="<?= e($currentLang) ?>">
        <?php foreach ($languages as $code => $meta): ?>
            <button
                class="language-chip<?= $currentLang === $code ? ' is-active' : '' ?>"
                type="button"
                data-lang-option="<?= e($code) ?>"
                aria-pressed="<?= $currentLang === $code ? 'true' : 'false' ?>"
            >
                <strong><?= e($meta['badge']) ?></strong>
                <span><?= $meta['label'] ?></span>
            </button>
        <?php endforeach; ?>
    </form>

    <div class="dropdown-label">Tema</div>
    <div class="theme-choice-grid" data-theme-choice-group>
        <button class="theme-choice" type="button" data-theme-option="dark" aria-pressed="false">
            <strong>Dark</strong>
            <span>Karanlik</span>
        </button>
        <button class="theme-choice" type="button" data-theme-option="light" aria-pressed="false">
            <strong>Light</strong>
            <span>Aydinlik</span>
        </button>
        <button class="theme-choice" type="button" data-theme-option="system" aria-pressed="false">
            <strong>System</strong>
            <span>Sistem</span>
        </button>
    </div>
</div>
