<script setup lang="ts">
import { useMailStore } from '~/modules/mail/stores/mail'

const store = useMailStore()
const { syncing } = storeToRefs(store)

const { t } = useI18n()

async function handleRefresh(): Promise<void> {
    await store.triggerSync()
}
</script>

<template>
    <MalioButton
        :label="t('mail.actions.refresh')"
        variant="secondary"
        icon-name="material-symbols:refresh"
        icon-position="left"
        :icon-size="16"
        :disabled="syncing"
        @click="handleRefresh"
    />
</template>
