@escalated-dev/escalated 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,77 +1,99 @@
1
- <script setup>
2
- import { inject, computed } from 'vue';
3
- import StatusBadge from './StatusBadge.vue';
4
- import PriorityBadge from './PriorityBadge.vue';
5
- import SlaTimer from './SlaTimer.vue';
6
- import AssigneeSelect from './AssigneeSelect.vue';
7
- import TagSelect from './TagSelect.vue';
8
- import ActivityTimeline from './ActivityTimeline.vue';
9
-
10
- defineProps({
11
- ticket: { type: Object, required: true },
12
- agents: { type: Array, default: () => [] },
13
- tags: { type: Array, default: () => [] },
14
- activities: { type: Array, default: () => [] },
15
- editable: { type: Boolean, default: false },
16
- });
17
-
18
- const emit = defineEmits(['assign', 'tags', 'priority', 'department', 'status']);
19
- const escDark = inject('esc-dark', computed(() => false));
20
-
21
- const cardClass = computed(() => escDark.value
22
- ? 'rounded-xl border border-white/[0.06] bg-neutral-900/60 p-4'
23
- : 'rounded-lg border border-gray-200 bg-white p-4'
24
- );
25
- </script>
26
-
27
- <template>
28
- <aside class="space-y-4">
29
- <div :class="cardClass">
30
- <h3 :class="['mb-3 text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">Details</h3>
31
- <dl class="space-y-2 text-sm">
32
- <div class="flex justify-between">
33
- <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Status</dt>
34
- <dd><StatusBadge :status="ticket.status" /></dd>
35
- </div>
36
- <div class="flex justify-between">
37
- <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Priority</dt>
38
- <dd><PriorityBadge :priority="ticket.priority" /></dd>
39
- </div>
40
- <div class="flex justify-between">
41
- <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Reference</dt>
42
- <dd :class="['font-mono text-xs', escDark ? 'text-white' : '']">{{ ticket.reference }}</dd>
43
- </div>
44
- <div v-if="ticket.department" class="flex justify-between">
45
- <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Department</dt>
46
- <dd :class="escDark ? 'text-neutral-300' : ''">{{ ticket.department.name }}</dd>
47
- </div>
48
- <div class="flex justify-between">
49
- <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Created</dt>
50
- <dd :class="escDark ? 'text-neutral-300' : ''">{{ new Date(ticket.created_at).toLocaleDateString() }}</dd>
51
- </div>
52
- </dl>
53
- </div>
54
-
55
- <div v-if="ticket.first_response_due_at || ticket.resolution_due_at" class="space-y-2">
56
- <SlaTimer v-if="ticket.first_response_due_at" :due-at="ticket.first_response_due_at"
57
- :breached="ticket.sla_first_response_breached" label="First Response" />
58
- <SlaTimer v-if="ticket.resolution_due_at" :due-at="ticket.resolution_due_at"
59
- :breached="ticket.sla_resolution_breached" label="Resolution" />
60
- </div>
61
-
62
- <div v-if="editable && agents.length" :class="cardClass">
63
- <AssigneeSelect :agents="agents" :model-value="ticket.assigned_to"
64
- @update:model-value="emit('assign', $event)" />
65
- </div>
66
-
67
- <div v-if="editable && tags.length" :class="cardClass">
68
- <TagSelect :tags="tags" :model-value="(ticket.tags || []).map(t => t.id)"
69
- @update:model-value="emit('tags', $event)" />
70
- </div>
71
-
72
- <div v-if="activities.length" :class="cardClass">
73
- <h3 :class="['mb-3 text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">Activity</h3>
74
- <ActivityTimeline :activities="activities" />
75
- </div>
76
- </aside>
77
- </template>
1
+ <script setup>
2
+ import { inject, computed } from 'vue';
3
+ import StatusBadge from './StatusBadge.vue';
4
+ import PriorityBadge from './PriorityBadge.vue';
5
+ import SlaTimer from './SlaTimer.vue';
6
+ import AssigneeSelect from './AssigneeSelect.vue';
7
+ import TagSelect from './TagSelect.vue';
8
+ import ActivityTimeline from './ActivityTimeline.vue';
9
+
10
+ defineProps({
11
+ ticket: { type: Object, required: true },
12
+ agents: { type: Array, default: () => [] },
13
+ tags: { type: Array, default: () => [] },
14
+ activities: { type: Array, default: () => [] },
15
+ editable: { type: Boolean, default: false },
16
+ });
17
+
18
+ const emit = defineEmits(['assign', 'tags', 'priority', 'department', 'status']);
19
+ const escDark = inject('esc-dark', computed(() => false));
20
+
21
+ const cardClass = computed(() => escDark.value
22
+ ? 'rounded-xl border border-white/[0.06] bg-neutral-900/60 p-4'
23
+ : 'rounded-lg border border-gray-200 bg-white p-4'
24
+ );
25
+
26
+ function renderStars(rating) {
27
+ return Array.from({ length: 5 }, (_, i) => i < rating ? 'filled' : 'empty');
28
+ }
29
+ </script>
30
+
31
+ <template>
32
+ <aside class="space-y-4">
33
+ <div :class="cardClass">
34
+ <h3 :class="['mb-3 text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">Details</h3>
35
+ <dl class="space-y-2 text-sm">
36
+ <div class="flex justify-between">
37
+ <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Status</dt>
38
+ <dd><StatusBadge :status="ticket.status" /></dd>
39
+ </div>
40
+ <div class="flex justify-between">
41
+ <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Priority</dt>
42
+ <dd><PriorityBadge :priority="ticket.priority" /></dd>
43
+ </div>
44
+ <div class="flex justify-between">
45
+ <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Reference</dt>
46
+ <dd :class="['font-mono text-xs', escDark ? 'text-white' : '']">{{ ticket.reference }}</dd>
47
+ </div>
48
+ <div v-if="ticket.department" class="flex justify-between">
49
+ <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Department</dt>
50
+ <dd :class="escDark ? 'text-neutral-300' : ''">{{ ticket.department.name }}</dd>
51
+ </div>
52
+ <div class="flex justify-between">
53
+ <dt :class="escDark ? 'text-neutral-500' : 'text-gray-500'">Created</dt>
54
+ <dd :class="escDark ? 'text-neutral-300' : ''">{{ new Date(ticket.created_at).toLocaleDateString() }}</dd>
55
+ </div>
56
+ </dl>
57
+ </div>
58
+
59
+ <!-- Satisfaction Rating (read-only) -->
60
+ <div v-if="ticket.satisfaction_rating" :class="cardClass">
61
+ <h3 :class="['mb-3 text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">Customer Satisfaction</h3>
62
+ <div class="flex items-center gap-1">
63
+ <svg v-for="(star, i) in renderStars(ticket.satisfaction_rating.rating)" :key="i"
64
+ class="h-5 w-5" :class="star === 'filled' ? 'text-amber-400' : (escDark ? 'text-neutral-700' : 'text-gray-300')"
65
+ fill="currentColor" viewBox="0 0 20 20">
66
+ <path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
67
+ </svg>
68
+ <span :class="['ml-2 text-sm font-medium', escDark ? 'text-neutral-300' : 'text-gray-700']">
69
+ {{ ticket.satisfaction_rating.rating }}/5
70
+ </span>
71
+ </div>
72
+ <p v-if="ticket.satisfaction_rating.comment" :class="['mt-2 text-xs italic', escDark ? 'text-neutral-500' : 'text-gray-500']">
73
+ "{{ ticket.satisfaction_rating.comment }}"
74
+ </p>
75
+ </div>
76
+
77
+ <div v-if="ticket.first_response_due_at || ticket.resolution_due_at" class="space-y-2">
78
+ <SlaTimer v-if="ticket.first_response_due_at" :due-at="ticket.first_response_due_at"
79
+ :breached="ticket.sla_first_response_breached" label="First Response" />
80
+ <SlaTimer v-if="ticket.resolution_due_at" :due-at="ticket.resolution_due_at"
81
+ :breached="ticket.sla_resolution_breached" label="Resolution" />
82
+ </div>
83
+
84
+ <div v-if="editable && agents.length" :class="cardClass">
85
+ <AssigneeSelect :agents="agents" :model-value="ticket.assigned_to"
86
+ @update:model-value="emit('assign', $event)" />
87
+ </div>
88
+
89
+ <div v-if="editable && tags.length" :class="cardClass">
90
+ <TagSelect :tags="tags" :model-value="(ticket.tags || []).map(t => t.id)"
91
+ @update:model-value="emit('tags', $event)" />
92
+ </div>
93
+
94
+ <div v-if="activities.length" :class="cardClass">
95
+ <h3 :class="['mb-3 text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">Activity</h3>
96
+ <ActivityTimeline :activities="activities" />
97
+ </div>
98
+ </aside>
99
+ </template>
@@ -0,0 +1,46 @@
1
+ import { onMounted, onUnmounted, unref } from 'vue';
2
+
3
+ /**
4
+ * Composable for registering keyboard shortcuts.
5
+ *
6
+ * @param {Object} shortcuts - Map of key to handler function, e.g. { 'r': () => {}, 'n': () => {} }
7
+ * @param {Object} options - Optional configuration
8
+ * @param {import('vue').Ref<boolean>} options.enabled - Ref controlling whether shortcuts are active (default: true)
9
+ */
10
+ export function useKeyboardShortcuts(shortcuts, options = {}) {
11
+ const ignoredTags = new Set(['INPUT', 'TEXTAREA', 'SELECT']);
12
+
13
+ function handleKeydown(event) {
14
+ // Check if shortcuts are enabled
15
+ if (options.enabled !== undefined && !unref(options.enabled)) {
16
+ return;
17
+ }
18
+
19
+ // Skip when focus is inside form elements or contenteditable
20
+ const target = event.target;
21
+ if (target && (ignoredTags.has(target.tagName) || target.isContentEditable)) {
22
+ return;
23
+ }
24
+
25
+ // Skip if modifier keys are held (allow shift for ? and similar)
26
+ if (event.ctrlKey || event.metaKey || event.altKey) {
27
+ return;
28
+ }
29
+
30
+ const key = event.key;
31
+ const handler = shortcuts[key];
32
+
33
+ if (handler && typeof handler === 'function') {
34
+ event.preventDefault();
35
+ handler(event);
36
+ }
37
+ }
38
+
39
+ onMounted(() => {
40
+ document.addEventListener('keydown', handleKeydown);
41
+ });
42
+
43
+ onUnmounted(() => {
44
+ document.removeEventListener('keydown', handleKeydown);
45
+ });
46
+ }
package/src/index.js CHANGED
@@ -5,11 +5,19 @@ export { EscalatedPlugin } from './plugin'
5
5
  export { default as ActivityTimeline } from './components/ActivityTimeline.vue'
6
6
  export { default as AssigneeSelect } from './components/AssigneeSelect.vue'
7
7
  export { default as AttachmentList } from './components/AttachmentList.vue'
8
+ export { default as BulkActionBar } from './components/BulkActionBar.vue'
8
9
  export { default as EscalatedLayout } from './components/EscalatedLayout.vue'
9
10
  export { default as FileDropzone } from './components/FileDropzone.vue'
11
+ export { default as FollowButton } from './components/FollowButton.vue'
12
+ export { default as KeyboardShortcutHelp } from './components/KeyboardShortcutHelp.vue'
13
+ export { default as MacroDropdown } from './components/MacroDropdown.vue'
14
+ export { default as PinnedNotes } from './components/PinnedNotes.vue'
15
+ export { default as PresenceIndicator } from './components/PresenceIndicator.vue'
10
16
  export { default as PriorityBadge } from './components/PriorityBadge.vue'
17
+ export { default as QuickFilters } from './components/QuickFilters.vue'
11
18
  export { default as ReplyComposer } from './components/ReplyComposer.vue'
12
19
  export { default as ReplyThread } from './components/ReplyThread.vue'
20
+ export { default as SatisfactionRating } from './components/SatisfactionRating.vue'
13
21
  export { default as SlaTimer } from './components/SlaTimer.vue'
14
22
  export { default as StatsCard } from './components/StatsCard.vue'
15
23
  export { default as StatusBadge } from './components/StatusBadge.vue'
@@ -17,3 +25,6 @@ export { default as TagSelect } from './components/TagSelect.vue'
17
25
  export { default as TicketFilters } from './components/TicketFilters.vue'
18
26
  export { default as TicketList } from './components/TicketList.vue'
19
27
  export { default as TicketSidebar } from './components/TicketSidebar.vue'
28
+
29
+ // Composables
30
+ export { useKeyboardShortcuts } from './composables/useKeyboardShortcuts'
@@ -0,0 +1,287 @@
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { useForm, router } from '@inertiajs/vue3';
4
+ import { ref, computed } from 'vue';
5
+
6
+ defineProps({ macros: Array });
7
+
8
+ const showForm = ref(false);
9
+ const editingMacro = ref(null);
10
+
11
+ const form = useForm({
12
+ name: '',
13
+ description: '',
14
+ is_shared: false,
15
+ actions: [],
16
+ });
17
+
18
+ const actionTypes = [
19
+ { value: 'status', label: 'Set Status' },
20
+ { value: 'priority', label: 'Set Priority' },
21
+ { value: 'assign', label: 'Assign To' },
22
+ { value: 'tags', label: 'Add Tags' },
23
+ { value: 'department', label: 'Move to Department' },
24
+ { value: 'reply', label: 'Send Reply' },
25
+ { value: 'note', label: 'Add Internal Note' },
26
+ ];
27
+
28
+ const statusOptions = ['open', 'in_progress', 'waiting_on_customer', 'resolved', 'closed'];
29
+ const priorityOptions = ['low', 'medium', 'high', 'urgent', 'critical'];
30
+
31
+ function addAction() {
32
+ form.actions.push({ type: 'status', value: '', order: form.actions.length });
33
+ }
34
+
35
+ function removeAction(index) {
36
+ form.actions.splice(index, 1);
37
+ form.actions.forEach((a, i) => { a.order = i; });
38
+ }
39
+
40
+ function moveAction(index, direction) {
41
+ const newIndex = index + direction;
42
+ if (newIndex < 0 || newIndex >= form.actions.length) return;
43
+ const temp = form.actions[index];
44
+ form.actions[index] = form.actions[newIndex];
45
+ form.actions[newIndex] = temp;
46
+ form.actions.forEach((a, i) => { a.order = i; });
47
+ }
48
+
49
+ function create() {
50
+ form.post(route('escalated.admin.macros.store'), {
51
+ onSuccess: () => { form.reset(); showForm.value = false; },
52
+ });
53
+ }
54
+
55
+ function startEdit(macro) {
56
+ editingMacro.value = macro.id;
57
+ form.name = macro.name;
58
+ form.description = macro.description || '';
59
+ form.is_shared = macro.is_shared || false;
60
+ form.actions = (macro.actions || []).map((a, i) => ({
61
+ type: a.type,
62
+ value: a.value || '',
63
+ order: a.order ?? i,
64
+ }));
65
+ showForm.value = true;
66
+ }
67
+
68
+ function update() {
69
+ form.put(route('escalated.admin.macros.update', editingMacro.value), {
70
+ onSuccess: () => { editingMacro.value = null; form.reset(); showForm.value = false; },
71
+ });
72
+ }
73
+
74
+ function destroy(id) {
75
+ if (confirm('Delete this macro? This cannot be undone.')) {
76
+ router.delete(route('escalated.admin.macros.destroy', id));
77
+ }
78
+ }
79
+
80
+ function cancelEdit() {
81
+ editingMacro.value = null;
82
+ form.reset();
83
+ showForm.value = false;
84
+ }
85
+
86
+ function handleSubmit() {
87
+ if (editingMacro.value) {
88
+ update();
89
+ } else {
90
+ create();
91
+ }
92
+ }
93
+
94
+ const inputClass = 'w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 placeholder-neutral-600 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10';
95
+ const selectClass = 'rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10';
96
+ </script>
97
+
98
+ <template>
99
+ <EscalatedLayout title="Macros">
100
+ <!-- Top bar -->
101
+ <div class="mb-4 flex items-center justify-between">
102
+ <p class="text-sm text-neutral-500">
103
+ Macros automate repetitive actions on tickets.
104
+ </p>
105
+ <button @click="showForm ? cancelEdit() : (showForm = true)"
106
+ :class="showForm
107
+ ? 'rounded-lg border border-white/10 bg-white/[0.03] px-4 py-2 text-sm font-medium text-neutral-300 transition-colors hover:bg-white/[0.06]'
108
+ : 'rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-4 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400'">
109
+ {{ showForm ? 'Cancel' : 'Create Macro' }}
110
+ </button>
111
+ </div>
112
+
113
+ <!-- Create/Edit form -->
114
+ <form v-if="showForm" @submit.prevent="handleSubmit" class="mb-6 space-y-4 rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
115
+ <div class="grid grid-cols-2 gap-4">
116
+ <div>
117
+ <label class="mb-1 block text-sm font-medium text-neutral-300">Name</label>
118
+ <input v-model="form.name" type="text" required placeholder="e.g., Close & Thank"
119
+ :class="inputClass" />
120
+ </div>
121
+ <div>
122
+ <label class="mb-1 block text-sm font-medium text-neutral-300">Description</label>
123
+ <input v-model="form.description" type="text" placeholder="Optional description"
124
+ :class="inputClass" />
125
+ </div>
126
+ </div>
127
+
128
+ <div class="flex items-center gap-3">
129
+ <label class="flex items-center gap-2">
130
+ <input v-model="form.is_shared" type="checkbox"
131
+ class="rounded border-white/20 bg-neutral-900 text-cyan-500 focus:ring-white/10" />
132
+ <span class="text-sm text-neutral-300">Shared with all agents</span>
133
+ </label>
134
+ </div>
135
+
136
+ <!-- Action builder -->
137
+ <div>
138
+ <div class="mb-2 flex items-center justify-between">
139
+ <label class="text-sm font-medium text-neutral-300">Actions</label>
140
+ <button type="button" @click="addAction"
141
+ class="rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-xs font-medium text-neutral-400 transition-colors hover:bg-white/[0.06] hover:text-neutral-200">
142
+ + Add Action
143
+ </button>
144
+ </div>
145
+
146
+ <div v-if="!form.actions.length" class="rounded-lg border border-dashed border-white/10 px-4 py-6 text-center">
147
+ <p class="text-sm text-neutral-600">No actions yet. Add actions to define what this macro does.</p>
148
+ </div>
149
+
150
+ <div v-else class="space-y-2">
151
+ <div v-for="(action, index) in form.actions" :key="index"
152
+ class="flex items-center gap-2 rounded-lg border border-white/[0.06] bg-white/[0.02] p-3">
153
+ <!-- Order controls -->
154
+ <div class="flex flex-col gap-0.5">
155
+ <button type="button" @click="moveAction(index, -1)"
156
+ :disabled="index === 0"
157
+ class="rounded p-0.5 text-neutral-600 transition-colors hover:bg-white/[0.06] hover:text-neutral-400 disabled:opacity-30">
158
+ <svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
159
+ <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 15.75l7.5-7.5 7.5 7.5" />
160
+ </svg>
161
+ </button>
162
+ <button type="button" @click="moveAction(index, 1)"
163
+ :disabled="index === form.actions.length - 1"
164
+ class="rounded p-0.5 text-neutral-600 transition-colors hover:bg-white/[0.06] hover:text-neutral-400 disabled:opacity-30">
165
+ <svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
166
+ <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
167
+ </svg>
168
+ </button>
169
+ </div>
170
+
171
+ <!-- Action number -->
172
+ <span class="flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-white/[0.06] text-xs font-semibold text-neutral-500">
173
+ {{ index + 1 }}
174
+ </span>
175
+
176
+ <!-- Type dropdown -->
177
+ <select v-model="action.type" :class="selectClass">
178
+ <option v-for="at in actionTypes" :key="at.value" :value="at.value">{{ at.label }}</option>
179
+ </select>
180
+
181
+ <!-- Value input (context-dependent) -->
182
+ <select v-if="action.type === 'status'" v-model="action.value" :class="[selectClass, 'flex-1']">
183
+ <option value="">Select status...</option>
184
+ <option v-for="s in statusOptions" :key="s" :value="s">{{ s.replace(/_/g, ' ') }}</option>
185
+ </select>
186
+
187
+ <select v-else-if="action.type === 'priority'" v-model="action.value" :class="[selectClass, 'flex-1']">
188
+ <option value="">Select priority...</option>
189
+ <option v-for="p in priorityOptions" :key="p" :value="p">{{ p }}</option>
190
+ </select>
191
+
192
+ <input v-else-if="action.type === 'assign'" v-model="action.value" type="text"
193
+ placeholder="Agent ID or email"
194
+ :class="[inputClass, 'flex-1']" />
195
+
196
+ <input v-else-if="action.type === 'tags'" v-model="action.value" type="text"
197
+ placeholder="Comma-separated tag names"
198
+ :class="[inputClass, 'flex-1']" />
199
+
200
+ <input v-else-if="action.type === 'department'" v-model="action.value" type="text"
201
+ placeholder="Department ID or name"
202
+ :class="[inputClass, 'flex-1']" />
203
+
204
+ <textarea v-else-if="action.type === 'reply' || action.type === 'note'"
205
+ v-model="action.value" rows="2"
206
+ :placeholder="action.type === 'reply' ? 'Reply message...' : 'Note content...'"
207
+ :class="[inputClass, 'flex-1']">
208
+ </textarea>
209
+
210
+ <input v-else v-model="action.value" type="text" placeholder="Value"
211
+ :class="[inputClass, 'flex-1']" />
212
+
213
+ <!-- Remove -->
214
+ <button type="button" @click="removeAction(index)"
215
+ class="shrink-0 rounded-lg p-1.5 text-neutral-600 transition-colors hover:bg-rose-500/10 hover:text-rose-400">
216
+ <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
217
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
218
+ </svg>
219
+ </button>
220
+ </div>
221
+ </div>
222
+ </div>
223
+
224
+ <!-- Submit -->
225
+ <div class="flex justify-end">
226
+ <button type="submit" :disabled="form.processing"
227
+ class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-5 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400 disabled:opacity-50">
228
+ {{ editingMacro ? 'Update Macro' : 'Create Macro' }}
229
+ </button>
230
+ </div>
231
+ </form>
232
+
233
+ <!-- Macros table -->
234
+ <div class="overflow-hidden rounded-xl border border-white/[0.06] bg-neutral-900/60">
235
+ <table class="min-w-full divide-y divide-white/[0.06]">
236
+ <thead>
237
+ <tr class="bg-white/[0.02]">
238
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Name</th>
239
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Description</th>
240
+ <th class="px-4 py-3 text-center text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Actions</th>
241
+ <th class="px-4 py-3 text-center text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Shared</th>
242
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Creator</th>
243
+ <th class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-neutral-500"></th>
244
+ </tr>
245
+ </thead>
246
+ <tbody class="divide-y divide-white/[0.04]">
247
+ <tr v-if="!macros?.length">
248
+ <td colspan="6" class="px-4 py-12 text-center">
249
+ <svg class="mx-auto mb-3 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
250
+ <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" />
251
+ </svg>
252
+ <p class="text-sm text-neutral-500">No macros yet</p>
253
+ <p class="mt-1 text-xs text-neutral-600">Create macros to automate repetitive ticket actions</p>
254
+ </td>
255
+ </tr>
256
+ <tr v-for="macro in macros" :key="macro.id" class="transition-colors hover:bg-white/[0.03]">
257
+ <td class="px-4 py-3">
258
+ <span class="text-sm font-medium text-neutral-200">{{ macro.name }}</span>
259
+ </td>
260
+ <td class="px-4 py-3">
261
+ <span class="text-sm text-neutral-400">{{ macro.description || '--' }}</span>
262
+ </td>
263
+ <td class="px-4 py-3 text-center">
264
+ <span class="inline-flex items-center rounded-full bg-white/[0.06] px-2 py-0.5 text-xs font-medium text-neutral-400 ring-1 ring-white/[0.06]">
265
+ {{ macro.actions?.length || 0 }}
266
+ </span>
267
+ </td>
268
+ <td class="px-4 py-3 text-center">
269
+ <span v-if="macro.is_shared"
270
+ class="inline-flex items-center rounded-full bg-cyan-500/10 px-2 py-0.5 text-xs font-medium text-cyan-400 ring-1 ring-cyan-500/20">
271
+ Shared
272
+ </span>
273
+ <span v-else class="text-xs text-neutral-600">Private</span>
274
+ </td>
275
+ <td class="px-4 py-3 text-sm text-neutral-400">
276
+ {{ macro.creator?.name || macro.user?.name || '--' }}
277
+ </td>
278
+ <td class="px-4 py-3 text-right text-sm">
279
+ <button @click="startEdit(macro)" class="text-neutral-300 hover:text-white">Edit</button>
280
+ <button @click="destroy(macro.id)" class="ml-3 text-rose-400 hover:text-rose-300">Delete</button>
281
+ </td>
282
+ </tr>
283
+ </tbody>
284
+ </table>
285
+ </div>
286
+ </EscalatedLayout>
287
+ </template>