<template>
  <a-dropdown trigger="hover" @select="handleSelect">
    <div class="header-right-language-item">
      <img class="icon-language-img" src="../../../assets/language-1.png" />
    </div>

    <template #content>
      <a-doption value="zh">中文</a-doption>
      <a-doption value="en">English</a-doption>
    </template>
  </a-dropdown>
</template>

<script setup>
import { setI18nLanguage } from '../../../i18n';

const props = defineProps({
  label: String
});

const handleSelect = (value) => {
  setI18nLanguage(value);
};
</script>

<style lang="css" scoped>
.header-right-language-item {
  color: var(--color-text-2);
  width: 30px;
  height: 30px;
  border-radius: 20px;
  border: solid 1px var(--color-border-2);

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
}

.icon-language-img {
  width: 16px;
}
</style>
