<div class="dropdown" x-data="{ families: [] }" x-init="$store.theme.families().then(f => families = f)">
    <i
        class="bi bi-palette {{ icon_size|default:'fs-2' }} mx-2 cursor-pointer"
        id="theme_dropdown_button"
        data-bs-toggle="dropdown"
        aria-expanded="false"
    ></i>

    <ul class="dropdown-menu py-0" aria-labelledby="theme_dropdown_button">
        <li>
            <h6 class="dropdown-header fs--1" x-text="$store.theme.get_current_display_name()"></h6>
        </li>

        <li>
            <a class="dropdown-item fs--1" href="#" @click.prevent="$store.theme.toggle()">
                Toggle Mode
            </a>
        </li>

        <li><hr class="dropdown-divider"></li>

        <template x-for="family in families" :key="family.value">
            <li>
                <a
                    class="dropdown-item fs--1"
                    href="#"
                    @click.prevent="$store.theme.set_family(family.value)"
                    x-text="family.name"
                ></a>
            </li>
        </template>
    </ul>
</div>
