Fix toast dismiss, add delete confirms, and polish dashboard CTAs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 14:07:42 +02:00
co-authored by Cursor
parent d97bcea99e
commit 4411443fba
6 changed files with 89 additions and 19 deletions
+13 -1
View File
@@ -6,6 +6,7 @@ import AdminIcon from '@/components/icons/AdminIcon.vue'
import StatusBadge from '@/components/ui/StatusBadge.vue'
import { orders } from '@/data/mockData'
import { formatCurrency, formatNumber } from '@/utils/format'
import { confirm } from '@/composables/useConfirm'
import type { OrderItem } from '@/types'
const route = useRoute()
@@ -41,7 +42,18 @@ function goBack() {
router.push('/orders')
}
function removeItem(id: string) {
async function removeItem(id: string) {
const item = items.value.find((entry) => entry.id === id)
const ok = await confirm({
title: 'حذف محصول',
message: item
? `آیا از حذف «${item.productName}» از سفارش مطمئن هستید؟`
: 'آیا از حذف این محصول از سفارش مطمئن هستید؟',
confirmLabel: 'حذف',
cancelLabel: 'انصراف',
tone: 'danger',
})
if (!ok) return
items.value = items.value.filter((i) => i.id !== id)
}