Fix toast dismiss, add delete confirms, and polish dashboard CTAs.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user