<script setup lang="ts">
import { useVModel } from '@vueuse/core'

interface Events {
  (e: 'update:modelValue', value: boolean): void
}

interface Props {
  modelValue: boolean
}

const emit = defineEmits<Events>()
const props = defineProps<Props>()
const value = useVModel(props, 'modelValue', emit)
</script>

<template>
  <a
    role="button"
    class="collapse link"
    @click.prevent="value = !value"
  >
    <translate
      v-if="value"
    >
      Expand
    </translate>
    <translate
      v-else
    >
      Collapse
    </translate>
    <i :class="[{ down: !value, right: value }, 'angle', 'icon']" />
  </a>
</template>
