<template>
  <v-menu>
    <template #activator="{ props }">
      <v-btn v-bind="props" variant="outlined" prepend-icon="mdi-wrench" append-icon="mdi-chevron-down">
        Maintenance
      </v-btn>
    </template>
    <v-list density="compact">
      <v-list-item
        prepend-icon="mdi-refresh"
        title="Retry failed"
        subtitle="Re-queue every currently failing source"
        @click="emit('retry-failed')"
      />
      <v-list-item
        prepend-icon="mdi-broom"
        title="Force recovery sweep"
        subtitle="Mark stranded pending/running events as error (also runs every 5 min)"
        @click="emit('recover-stalled')"
      />
    </v-list>
  </v-menu>
</template>

<script setup>
// The Downloads tab parent (DownloadsTab.vue) owns the actual retry/sweep
// handlers — same toast + refresh logic already used by the failing-sources
// RETRY ALL button. We just emit. (A permanently-disabled "Export failed
// logs" stub sat here until 2026-07-02 — retired; the event list + detail
// modal cover forensics.)
const emit = defineEmits(['retry-failed', 'recover-stalled'])
</script>
