Files
homebox/frontend/components/ModalConfirm.vue
Nikolai Oakfield 3a4fae5eb8 Fix untranslated strings (#756)
* add missing translations and translate page titles

* fix: actually use the declared localized variables

* lint and prettier fixes

* add missing translations for toasts and confirms

* use components for shift/enter keys, add pluralization for photos, and fix primary photo conditional

* remove prop defaults since we're computing these anyways
2025-05-29 12:56:30 +00:00

38 lines
1.0 KiB
Vue

<template>
<AlertDialog :open="isRevealed">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{{ $t("global.confirm") }}</AlertDialogTitle>
<AlertDialogDescription> {{ text || $t("global.delete_confirm") }} </AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel @click="cancel(false)">
{{ $t("global.cancel") }}
</AlertDialogCancel>
<AlertDialogAction @click="confirm(true)">
{{ $t("global.confirm") }}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>
<script setup lang="ts">
import { useDialog } from "./ui/dialog-provider";
const { text, isRevealed, confirm, cancel } = useConfirm();
const { addAlert, removeAlert } = useDialog();
watch(
isRevealed,
val => {
if (val) {
addAlert("confirm-modal");
} else {
removeAlert("confirm-modal");
}
},
{ immediate: true }
);
</script>