<template>
  <a-tooltip :content="themeStore.tooltipText" position="bottom">
    <div
      class="theme-toggle-btn"
      @click="handleToggle"
    >
      {{ themeStore.isDark ? '🌙' : '☀️' }}
    </div>
  </a-tooltip>
</template>

<script setup>
import { useThemeStore } from '../stores/theme'

const themeStore = useThemeStore()

const handleToggle = () => {
  themeStore.toggleTheme()
}
</script>

<style scoped>
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  border-radius: var(--border-radius-small, 2px);
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--color-bg-2);
}

.theme-toggle-btn:active {
  background: var(--color-bg-3);
}
</style>
