<template>
  <UModal :open="isOpen" :title="$t('applicationForms.deleteTitle')" @update:open="$emit('update:isOpen', $event)">
    <template #body>
      {{ $t('applicationForms.deleteConfirm', { name: applicationFormToDelete.name }) }}
    </template>
    <template #footer>
      <UButton :label="$t('common.cancel')" color="neutral" variant="outline" @click="$emit('update:isOpen', false)" />
      <UButton :label="$t('common.delete')" color="neutral" @click="$emit('delete', applicationFormToDelete.id)" />
    </template>
  </UModal>
</template>

<script setup lang="ts">
import type { ApplicationFormDto } from '~~/.api-client'

defineEmits<{
  (e: 'delete', id: string): void
  (e: 'update:isOpen', value: boolean): void
}>()

defineProps<{
  applicationFormToDelete: ApplicationFormDto
  isOpen: boolean
}>()
</script>
