Files
FEDEO/frontend/components/ArchiveButton.vue
2026-01-06 12:09:31 +01:00

74 lines
1.4 KiB
Vue

<script setup>
const emit = defineEmits(['confirmed'])
const props = defineProps({
color: {
type: String,
required:false
},
variant: {
type: String,
required:false
},
type: {
type: String,
required:false
}
})
const {color,variant, type} = props
const dataStore = useDataStore()
const dataType = dataStore.dataTypes[type]
const showModal = ref(false)
const emitConfirm = () => {
showModal.value = false
emit('confirmed')
}
</script>
<template>
<UButton
:color="color"
:variant="variant"
@click="showModal = true"
>
Archivieren
</UButton>
<UModal v-model="showModal">
<UCard>
<template #header>
<span class="text-md font-bold">Archivieren bestätigen</span>
</template>
Möchten Sie diese/-s/-n {{dataType.labelSingle}} wirklich archivieren?
<template #footer>
<div class="text-right">
<UButtonGroup>
<UButton
variant="outline"
@click="showModal = false"
>
Abbrechen
</UButton>
<UButton
@click="emitConfirm"
class="ml-2"
color="rose"
>
Archivieren
</UButton>
</UButtonGroup>
</div>
</template>
</UCard>
</UModal>
</template>
<style scoped>
</style>