mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 21:33:02 +01:00
* 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
38 lines
1.0 KiB
Vue
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>
|