Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

1.2 KB
Raw Blame
<template>
  <UModal v-model:open="isOpen">
    <template #header>
      <h3 class="font-semibold">
        {{ t('projects.deleteConfirm') }}
      </h3>
    </template>

    <template #body>
      <p class="text-muted">
        {{ t('projects.deleteMessage', { name: project?.name }) }}
      </p>
    </template>

    <template #footer>
      <div class="flex justify-end gap-2 w-full">
        <UButton
          :label="t('common.no')"
          color="neutral"
          variant="soft"
          @click="close"
        />
        <UButton
          :label="t('common.yes')"
          color="error"
          class="min-w-12"
          variant="soft"
          :ui="{base: 'justify-center'}"
          data-testid="confirm-delete-button"
          @click="confirm"
        />
      </div>
    </template>
  </UModal>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import type { Project } from '@/components/features/projects/types'

defineProps<{
  project: Project | null
}>()

const isOpen = defineModel<boolean>('open', { required: true })

const emit = defineEmits<{
  confirm: []
}>()

const { t } = useI18n()

function close() {
  isOpen.value = false
}

function confirm() {
  emit('confirm')
  close()
}
</script>