<template>
  <v-btn color="primary" size="x-small" variant="text" @click="toggleSort()">
    <v-icon class="minsk-500" icon="swap_vert" start />
    <span class="minsk-900" style="font-size: 12px !important">{{ t('labels.sort') }}</span>
  </v-btn>
</template>

<script setup lang="ts">
import { useMcadStore } from '@/stores/mcad.store';
import { useI18n } from 'vue-i18n';

const { t } = useI18n();
const mcadStore = useMcadStore();

async function toggleSort(): Promise<void> {
  mcadStore.sortBy[0].order = mcadStore.sortBy[0].order === 'asc' ? 'desc' : 'asc';
}
</script>
