feat: add post deletion confirm dialog (#818)

Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
This commit is contained in:
PraZ 2023-01-07 09:55:01 +01:00 committed by GitHub
parent 2ff46bb8cb
commit d76e4bfaa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 78 additions and 8 deletions

View file

@ -0,0 +1,28 @@
<script setup lang="ts">
import type { ConfirmDialogChoice, ConfirmDialogLabel } from '~/types'
defineProps<ConfirmDialogLabel>()
const emit = defineEmits<{
(evt: 'choice', choice: ConfirmDialogChoice): void
}>()
</script>
<template>
<div flex="~ col" gap-6>
<div font-bold text-lg text-center>
{{ title }}
</div>
<div v-if="description">
{{ description }}
</div>
<div flex justify-end gap-2>
<button btn-text @click="emit('choice', 'cancel')">
{{ cancel || $t('common.confirm_dialog.cancel') }}
</button>
<button btn-solid @click="emit('choice', 'confirm')">
{{ confirm || $t('common.confirm_dialog.confirm') }}
</button>
</div>
</div>
</template>