<template>
  <v-select
    v-model="locale"
    :items="items"
    :key="`locale-${locale}`"
    density="compact"
    variant="plain"
    :hide-details="true"
  />
</template>

<script setup lang="ts">
  const items = [
    { value: 'fr', title: 'FR' },
    { value: 'en', title: 'EN' },
  ]

  const { setLocale } = useI18n()

  const locale = ref('fr')

  watch(locale, () => {
    setLocale(locale.value)
  });
</script>

<style scoped lang="scss">
:deep(.v-field__input) {
  padding: 0;
}

:deep(.v-field__append-inner) {
  padding-top: 3px !important;
}
</style>