<script lang="ts">
    import {onMount} from "svelte";
    import {Logger, logSetup} from "../scripts/logger";
    import {theme} from "../stores/ThemeStore";
    import {get} from "svelte/store";

    onMount(() => {
        let logger = new Logger("Theme.svelte");
        logSetup();

        theme.subscribe((newTheme) => {
            if (newTheme === "dark") {
                document.documentElement.classList.add("dark");
            } else {
                document.documentElement.classList.remove("dark");
            }
        });
    });
</script>

<svelte:head>
    <link rel="stylesheet" href="https://cdn.e3t.cc/fa/6.2.0/css/all.min.css"/>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@6.6.6/css/flag-icons.min.css"/>
</svelte:head>