Files
archie/ui/src/mappings/MappingDeleteDialog.vue
T
sam 4b921227c5 fix(ui): trim view prose, en dash placeholders, collapse fixed grids on phones
Drop empty-state essays that repeated their titles, the harness native select
becomes the Select component, and the binding and source forms collapse to one
column below sm. Issue-ID and history narration removed from comments.
2026-10-18 15:02:00 +11:00

47 lines
1.4 KiB
Vue

<script setup lang="ts">
import { Trash2 } from "@lucide/vue";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogMedia,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { cancelDelete, confirmDelete, pendingDelete } from "./state";
/**
* The destructive confirmation for one mapping. Deleting unprompted is not
* offered: a binding points at a mapping by id, so removing one without being
* asked would break a binding the operator still has.
*/
function onOpenChange(open: boolean) {
if (!open) cancelDelete();
}
</script>
<template>
<AlertDialog :open="pendingDelete !== null" @update:open="onOpenChange">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogMedia class="bg-danger-soft text-danger">
<Trash2 />
</AlertDialogMedia>
<AlertDialogTitle>Delete this mapping?</AlertDialogTitle>
<AlertDialogDescription>"{{ pendingDelete?.name }}" will be removed. Anything bound to it
stops resolving.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel @click="cancelDelete">Cancel</AlertDialogCancel>
<AlertDialogAction variant="destructive" @click="confirmDelete"
>Delete</AlertDialogAction
>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>