2024-07-05 01:02:53 +02:00
|
|
|
<script lang="ts">
|
2025-02-02 11:17:22 +01:00
|
|
|
import { Button } from '$lib/components/ui/button';
|
2025-06-21 21:07:36 +02:00
|
|
|
import { Moon, Sun } from '@lucide/svelte';
|
2025-06-08 16:32:41 +02:00
|
|
|
import { mode, setMode } from 'mode-watcher';
|
2025-06-21 21:07:36 +02:00
|
|
|
import { i18n } from '$lib/i18n.svelte';
|
2024-07-05 01:02:53 +02:00
|
|
|
</script>
|
|
|
|
|
|
2024-07-07 18:26:52 +02:00
|
|
|
<Button
|
2025-02-02 11:17:22 +01:00
|
|
|
variant="ghost"
|
2025-06-21 21:07:36 +02:00
|
|
|
size="icon"
|
|
|
|
|
onclick={() => {
|
2025-06-08 16:32:41 +02:00
|
|
|
setMode(mode.current === 'light' ? 'dark' : 'light');
|
2025-02-02 11:17:22 +01:00
|
|
|
}}
|
2025-06-21 21:07:36 +02:00
|
|
|
aria-label={i18n._('menu.mode')}
|
2024-07-07 18:26:52 +02:00
|
|
|
>
|
2025-06-08 16:32:41 +02:00
|
|
|
{#if mode.current === 'light'}
|
2025-10-20 19:53:42 +02:00
|
|
|
<Sun />
|
2025-02-02 11:17:22 +01:00
|
|
|
{:else}
|
2025-10-20 19:53:42 +02:00
|
|
|
<Moon />
|
2025-02-02 11:17:22 +01:00
|
|
|
{/if}
|
2024-07-07 18:26:52 +02:00
|
|
|
</Button>
|