diff --git a/web/src/views/OmgView.vue b/web/src/views/OmgView.vue index 006b648..2d19d25 100644 --- a/web/src/views/OmgView.vue +++ b/web/src/views/OmgView.vue @@ -6,7 +6,11 @@ import Input from '@/components/ui/Input.vue' import Textarea from '@/components/ui/Textarea.vue' import Button from '@/components/ui/Button.vue' import Spinner from '@/components/ui/Spinner.vue' +import ConfirmDialog from '@/components/ui/ConfirmDialog.vue' +import Tooltip from '@/components/ui/Tooltip.vue' +import EmptyState from '@/components/ui/EmptyState.vue' import { toast } from 'vue-sonner' +import { Pencil, Trash2, Plus, FileText } from 'lucide-vue-next' import type { OmgEntry } from '@/types' const entries = ref([]) @@ -22,6 +26,10 @@ const form = ref({ name: '', client: '', job_number: '', notes: '' }) const inlineEdit = ref<{ id: string; field: 'name' | 'client' | 'job_number' } | null>(null) const inlineValue = ref('') +// Confirm delete state +const showDeleteConfirm = ref(false) +const pendingDeleteId = ref(null) + onMounted(loadEntries) async function loadEntries() { @@ -82,10 +90,18 @@ async function handleSave() { } } -async function handleDelete(entry: OmgEntry) { +function requestDelete(entry: OmgEntry) { + pendingDeleteId.value = entry.id + showDeleteConfirm.value = true +} + +async function confirmDelete() { + if (!pendingDeleteId.value) return + const id = pendingDeleteId.value + pendingDeleteId.value = null try { - await omgApi.remove(entry.id) - entries.value = entries.value.filter(e => e.id !== entry.id) + await omgApi.remove(id) + entries.value = entries.value.filter(e => e.id !== id) toast.success('Entry deleted') } catch { toast.error('Failed to delete entry') @@ -138,14 +154,19 @@ function cancelInline() { -
- No entries yet. Click "Add entry" to create one. -
+
-
+
Project name Client Job # @@ -156,16 +177,16 @@ function cancelInline() {
-
-
- -
- - +
+ + + + + +
@@ -279,5 +302,13 @@ function cancelInline() { + + +