agent-ecosystem/landing/components/common/ThemeToggle.vue
iliya e6e89d4ebc fix(tests): improve messageId generation for legacy inbox rows
- Enhanced tests to ensure consistent messageId generation for legacy inbox rows lacking a messageId.
- Updated test descriptions for better clarity regarding the new messageId handling.
- Adjusted test expectations to align with the updated behavior of relaying legacy inbox rows with generated messageIds.
2026-03-23 16:31:37 +02:00

39 lines
973 B
Vue

<script setup lang="ts">
import { mdiWeatherSunny, mdiWeatherNight } from '@mdi/js';
const { t } = useI18n();
const { isDark, toggleTheme } = useBrowserTheme();
const { trackThemeToggle } = useAnalytics();
const tooltip = computed(() => isDark.value ? t('theme.light') : t('theme.dark'));
const onToggle = () => {
toggleTheme();
trackThemeToggle(isDark.value ? 'dark' : 'light');
};
</script>
<template>
<ClientOnly>
<v-tooltip :text="tooltip" location="bottom">
<template #activator="{ props }">
<v-btn
v-bind="props"
:icon="isDark ? mdiWeatherSunny : mdiWeatherNight"
variant="text"
size="small"
:aria-label="tooltip"
@click="onToggle"
/>
</template>
</v-tooltip>
<template #fallback>
<v-btn
:icon="mdiWeatherSunny"
variant="text"
size="small"
aria-label="Toggle theme"
/>
</template>
</ClientOnly>
</template>