@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,66 +1,101 @@
1
- <script setup>
2
- import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
- import StatsCard from '../../components/StatsCard.vue';
4
- import { router } from '@inertiajs/vue3';
5
-
6
- const props = defineProps({
7
- period_days: Number,
8
- total_tickets: Number,
9
- resolved_tickets: Number,
10
- avg_first_response_hours: Number,
11
- sla_breach_count: Number,
12
- by_status: Object,
13
- by_priority: Object,
14
- });
15
-
16
- function changePeriod(days) {
17
- router.get(route('escalated.admin.reports'), { days }, { preserveState: true });
18
- }
19
- </script>
20
-
21
- <template>
22
- <EscalatedLayout title="Reports">
23
- <div class="mb-6 flex gap-2">
24
- <button v-for="d in [7, 30, 90]" :key="d" @click="changePeriod(d)"
25
- :class="['rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all', period_days === d
26
- ? 'bg-gradient-to-r from-cyan-500 to-violet-500 text-white shadow-lg shadow-black/20'
27
- : 'border border-white/10 bg-white/[0.03] text-neutral-400 hover:bg-white/[0.06] hover:text-neutral-200']">
28
- Last {{ d }} days
29
- </button>
30
- </div>
31
- <div class="mb-8 grid grid-cols-2 gap-4 md:grid-cols-4">
32
- <StatsCard label="Total Tickets" :value="total_tickets" color="indigo" />
33
- <StatsCard label="Resolved" :value="resolved_tickets" color="green" />
34
- <StatsCard label="Avg First Response" :value="`${avg_first_response_hours}h`" color="yellow" />
35
- <StatsCard label="SLA Breaches" :value="sla_breach_count" color="red" />
36
- </div>
37
- <div class="grid grid-cols-1 gap-6 md:grid-cols-2">
38
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
39
- <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Status</h3>
40
- <template v-if="by_status && Object.keys(by_status).length">
41
- <div v-for="(count, status) in by_status" :key="status" class="mb-2.5 flex items-center justify-between">
42
- <span class="text-sm capitalize text-neutral-400">{{ status.replace('_', ' ') }}</span>
43
- <span class="text-sm font-semibold text-white">{{ count }}</span>
44
- </div>
45
- </template>
46
- <div v-else class="flex flex-col items-center py-6 text-center">
47
- <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" /></svg>
48
- <p class="text-sm text-neutral-500">No ticket data for this period</p>
49
- </div>
50
- </div>
51
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
52
- <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Priority</h3>
53
- <template v-if="by_priority && Object.keys(by_priority).length">
54
- <div v-for="(count, priority) in by_priority" :key="priority" class="mb-2.5 flex items-center justify-between">
55
- <span class="text-sm capitalize text-neutral-400">{{ priority }}</span>
56
- <span class="text-sm font-semibold text-white">{{ count }}</span>
57
- </div>
58
- </template>
59
- <div v-else class="flex flex-col items-center py-6 text-center">
60
- <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12" /></svg>
61
- <p class="text-sm text-neutral-500">No ticket data for this period</p>
62
- </div>
63
- </div>
64
- </div>
65
- </EscalatedLayout>
66
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
+ import StatsCard from '../../components/StatsCard.vue';
4
+ import { router } from '@inertiajs/vue3';
5
+
6
+ const props = defineProps({
7
+ period_days: Number,
8
+ total_tickets: Number,
9
+ resolved_tickets: Number,
10
+ avg_first_response_hours: Number,
11
+ sla_breach_count: Number,
12
+ by_status: Object,
13
+ by_priority: Object,
14
+ csat: { type: Object, default: () => ({}) },
15
+ });
16
+
17
+ function changePeriod(days) {
18
+ router.get(route('escalated.admin.reports'), { days }, { preserveState: true });
19
+ }
20
+
21
+ function renderStars(rating) {
22
+ return Array.from({ length: 5 }, (_, i) => i < Math.round(rating) ? 'filled' : 'empty');
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <EscalatedLayout title="Reports">
28
+ <div class="mb-6 flex gap-2">
29
+ <button v-for="d in [7, 30, 90]" :key="d" @click="changePeriod(d)"
30
+ :class="['rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all', period_days === d
31
+ ? 'bg-gradient-to-r from-cyan-500 to-violet-500 text-white shadow-lg shadow-black/20'
32
+ : 'border border-white/10 bg-white/[0.03] text-neutral-400 hover:bg-white/[0.06] hover:text-neutral-200']">
33
+ Last {{ d }} days
34
+ </button>
35
+ </div>
36
+ <div class="mb-8 grid grid-cols-2 gap-4 md:grid-cols-4">
37
+ <StatsCard label="Total Tickets" :value="total_tickets" color="indigo" />
38
+ <StatsCard label="Resolved" :value="resolved_tickets" color="green" />
39
+ <StatsCard label="Avg First Response" :value="`${avg_first_response_hours}h`" color="yellow" />
40
+ <StatsCard label="SLA Breaches" :value="sla_breach_count" color="red" />
41
+ </div>
42
+ <div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
43
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
44
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Status</h3>
45
+ <template v-if="by_status && Object.keys(by_status).length">
46
+ <div v-for="(count, status) in by_status" :key="status" class="mb-2.5 flex items-center justify-between">
47
+ <span class="text-sm capitalize text-neutral-400">{{ status.replace('_', ' ') }}</span>
48
+ <span class="text-sm font-semibold text-white">{{ count }}</span>
49
+ </div>
50
+ </template>
51
+ <div v-else class="flex flex-col items-center py-6 text-center">
52
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" /></svg>
53
+ <p class="text-sm text-neutral-500">No ticket data for this period</p>
54
+ </div>
55
+ </div>
56
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
57
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Priority</h3>
58
+ <template v-if="by_priority && Object.keys(by_priority).length">
59
+ <div v-for="(count, priority) in by_priority" :key="priority" class="mb-2.5 flex items-center justify-between">
60
+ <span class="text-sm capitalize text-neutral-400">{{ priority }}</span>
61
+ <span class="text-sm font-semibold text-white">{{ count }}</span>
62
+ </div>
63
+ </template>
64
+ <div v-else class="flex flex-col items-center py-6 text-center">
65
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12" /></svg>
66
+ <p class="text-sm text-neutral-500">No ticket data for this period</p>
67
+ </div>
68
+ </div>
69
+ <!-- CSAT -->
70
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
71
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">Customer Satisfaction</h3>
72
+ <template v-if="csat?.total > 0">
73
+ <div class="mb-3 flex items-center gap-2">
74
+ <div class="flex items-center gap-0.5">
75
+ <svg v-for="(star, i) in renderStars(csat.average)" :key="i"
76
+ class="h-5 w-5" :class="star === 'filled' ? 'text-amber-400' : 'text-neutral-700'"
77
+ fill="currentColor" viewBox="0 0 20 20">
78
+ <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" />
79
+ </svg>
80
+ </div>
81
+ <span class="text-lg font-bold text-white">{{ csat.average }}</span>
82
+ <span class="text-sm text-neutral-500">({{ csat.total }} ratings)</span>
83
+ </div>
84
+ <div v-if="csat.breakdown && Object.keys(csat.breakdown).length" class="space-y-1.5">
85
+ <div v-for="rating in [5, 4, 3, 2, 1]" :key="rating" class="flex items-center gap-2">
86
+ <span class="w-3 text-xs text-neutral-500">{{ rating }}</span>
87
+ <div class="h-2 flex-1 overflow-hidden rounded-full bg-white/[0.06]">
88
+ <div class="h-full rounded-full bg-amber-400" :style="{ width: `${csat.total ? ((csat.breakdown[rating] || 0) / csat.total) * 100 : 0}%` }"></div>
89
+ </div>
90
+ <span class="w-6 text-right text-xs text-neutral-500">{{ csat.breakdown[rating] || 0 }}</span>
91
+ </div>
92
+ </div>
93
+ </template>
94
+ <div v-else class="flex flex-col items-center py-6 text-center">
95
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>
96
+ <p class="text-sm text-neutral-500">No ratings for this period</p>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </EscalatedLayout>
101
+ </template>
@@ -1,22 +1,39 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import TicketList from '../../../components/TicketList.vue';
4
- import TicketFilters from '../../../components/TicketFilters.vue';
5
-
6
- defineProps({
7
- tickets: Object,
8
- filters: Object,
9
- departments: Array,
10
- tags: Array,
11
- agents: Array,
12
- });
13
- </script>
14
-
15
- <template>
16
- <EscalatedLayout title="All Tickets">
17
- <div class="mb-6">
18
- <TicketFilters :filters="filters" :route="route('escalated.admin.tickets.index')" :departments="departments" :tags="tags" show-assignee />
19
- </div>
20
- <TicketList :tickets="tickets" route-prefix="escalated.admin.tickets" show-assignee />
21
- </EscalatedLayout>
22
- </template>
1
+ <script setup>
2
+ import { ref } from 'vue';
3
+ import { usePage, router } from '@inertiajs/vue3';
4
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
5
+ import TicketList from '../../../components/TicketList.vue';
6
+ import TicketFilters from '../../../components/TicketFilters.vue';
7
+ import QuickFilters from '../../../components/QuickFilters.vue';
8
+ import BulkActionBar from '../../../components/BulkActionBar.vue';
9
+
10
+ defineProps({
11
+ tickets: Object,
12
+ filters: Object,
13
+ departments: Array,
14
+ tags: Array,
15
+ agents: Array,
16
+ });
17
+
18
+ const page = usePage();
19
+ const selectedIds = ref([]);
20
+
21
+ function applyQuickFilter(filter) {
22
+ router.get(route('escalated.admin.tickets.index'), filter, { preserveState: true });
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <EscalatedLayout title="All Tickets">
28
+ <div class="mb-4">
29
+ <QuickFilters :current-user-id="page.props.auth?.user?.id" @filter="applyQuickFilter" />
30
+ </div>
31
+ <div class="mb-6">
32
+ <TicketFilters :filters="filters" :route="route('escalated.admin.tickets.index')" :departments="departments" :tags="tags" :agents="agents" show-assignee show-following />
33
+ </div>
34
+ <TicketList :tickets="tickets" route-prefix="escalated.admin.tickets" show-assignee
35
+ selectable v-model:selected-ids="selectedIds" />
36
+ <BulkActionBar :selected-ids="selectedIds" :bulk-route="route('escalated.admin.tickets.bulk')"
37
+ :agents="agents" :departments="departments" @clear="selectedIds = []" />
38
+ </EscalatedLayout>
39
+ </template>
@@ -1,109 +1,145 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import StatusBadge from '../../../components/StatusBadge.vue';
4
- import PriorityBadge from '../../../components/PriorityBadge.vue';
5
- import ReplyThread from '../../../components/ReplyThread.vue';
6
- import ReplyComposer from '../../../components/ReplyComposer.vue';
7
- import TicketSidebar from '../../../components/TicketSidebar.vue';
8
- import AttachmentList from '../../../components/AttachmentList.vue';
9
- import { router, useForm, usePage } from '@inertiajs/vue3';
10
- import { ref } from 'vue';
11
-
12
- const props = defineProps({
13
- ticket: Object,
14
- departments: Array,
15
- tags: Array,
16
- cannedResponses: Array,
17
- agents: Array,
18
- });
19
-
20
- const page = usePage();
21
- const activeTab = ref('reply');
22
-
23
- const statusForm = useForm({ status: '' });
24
- const priorityForm = useForm({ priority: '' });
25
- const assignForm = useForm({ agent_id: '' });
26
-
27
- function changeStatus(status) {
28
- statusForm.status = status;
29
- statusForm.post(route('escalated.admin.tickets.status', props.ticket.reference), { preserveScroll: true });
30
- }
31
-
32
- function changePriority(priority) {
33
- priorityForm.priority = priority;
34
- priorityForm.post(route('escalated.admin.tickets.priority', props.ticket.reference), { preserveScroll: true });
35
- }
36
-
37
- function assignToMe() {
38
- assignForm.agent_id = page.props.auth.user.id;
39
- assignForm.post(route('escalated.admin.tickets.assign', props.ticket.reference), { preserveScroll: true });
40
- }
41
- </script>
42
-
43
- <template>
44
- <EscalatedLayout :title="ticket.subject">
45
- <div class="mb-5 flex flex-wrap items-center gap-3">
46
- <span class="text-sm font-mono font-medium text-white">{{ ticket.reference }}</span>
47
- <StatusBadge :status="ticket.status" />
48
- <PriorityBadge :priority="ticket.priority" />
49
- <span class="text-sm text-neutral-500">by {{ ticket.requester?.name }}</span>
50
- <div class="ml-auto flex gap-2">
51
- <button v-if="!ticket.assigned_to" @click="assignToMe"
52
- class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-3 py-1.5 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400">
53
- Assign to Me
54
- </button>
55
- <select @change="changeStatus($event.target.value); $event.target.value = ''"
56
- class="rounded-lg border border-white/10 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
57
- <option value="">Change Status...</option>
58
- <option value="in_progress">In Progress</option>
59
- <option value="waiting_on_customer">Waiting on Customer</option>
60
- <option value="resolved">Resolved</option>
61
- <option value="closed">Closed</option>
62
- </select>
63
- <select @change="changePriority($event.target.value); $event.target.value = ''"
64
- class="rounded-lg border border-white/10 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
65
- <option value="">Change Priority...</option>
66
- <option value="low">Low</option>
67
- <option value="medium">Medium</option>
68
- <option value="high">High</option>
69
- <option value="urgent">Urgent</option>
70
- <option value="critical">Critical</option>
71
- </select>
72
- </div>
73
- </div>
74
- <div class="grid grid-cols-1 gap-6 lg:grid-cols-3">
75
- <div class="lg:col-span-2 space-y-6">
76
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
77
- <p class="whitespace-pre-wrap text-sm text-neutral-300">{{ ticket.description }}</p>
78
- <AttachmentList v-if="ticket.attachments?.length" :attachments="ticket.attachments" class="mt-3" />
79
- </div>
80
- <div>
81
- <div class="mb-4 flex gap-4 border-b border-white/[0.06]">
82
- <button @click="activeTab = 'reply'"
83
- :class="['pb-2 text-sm font-medium transition-colors', activeTab === 'reply' ? 'border-b-2 border-cyan-500 text-white' : 'text-neutral-500 hover:text-neutral-300']">
84
- Reply
85
- </button>
86
- <button @click="activeTab = 'note'"
87
- :class="['pb-2 text-sm font-medium transition-colors', activeTab === 'note' ? 'border-b-2 border-amber-500 text-amber-400' : 'text-neutral-500 hover:text-neutral-300']">
88
- Internal Note
89
- </button>
90
- </div>
91
- <ReplyComposer v-if="activeTab === 'reply'"
92
- :action="route('escalated.admin.tickets.reply', ticket.reference)"
93
- :canned-responses="cannedResponses" />
94
- <ReplyComposer v-else
95
- :action="route('escalated.admin.tickets.note', ticket.reference)"
96
- placeholder="Write an internal note..."
97
- submit-label="Add Note" />
98
- </div>
99
- <div>
100
- <h2 class="mb-4 text-lg font-semibold text-neutral-200">Conversation</h2>
101
- <ReplyThread :replies="ticket.replies || []" :current-user-id="page.props.auth?.user?.id" />
102
- </div>
103
- </div>
104
- <div>
105
- <TicketSidebar :ticket="ticket" :tags="tags" :departments="departments" />
106
- </div>
107
- </div>
108
- </EscalatedLayout>
109
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import StatusBadge from '../../../components/StatusBadge.vue';
4
+ import PriorityBadge from '../../../components/PriorityBadge.vue';
5
+ import ReplyThread from '../../../components/ReplyThread.vue';
6
+ import ReplyComposer from '../../../components/ReplyComposer.vue';
7
+ import TicketSidebar from '../../../components/TicketSidebar.vue';
8
+ import AttachmentList from '../../../components/AttachmentList.vue';
9
+ import MacroDropdown from '../../../components/MacroDropdown.vue';
10
+ import FollowButton from '../../../components/FollowButton.vue';
11
+ import PresenceIndicator from '../../../components/PresenceIndicator.vue';
12
+ import PinnedNotes from '../../../components/PinnedNotes.vue';
13
+ import KeyboardShortcutHelp from '../../../components/KeyboardShortcutHelp.vue';
14
+ import { useKeyboardShortcuts } from '../../../composables/useKeyboardShortcuts';
15
+ import { router, useForm, usePage } from '@inertiajs/vue3';
16
+ import { ref } from 'vue';
17
+
18
+ const props = defineProps({
19
+ ticket: Object,
20
+ departments: Array,
21
+ tags: Array,
22
+ cannedResponses: Array,
23
+ agents: Array,
24
+ macros: { type: Array, default: () => [] },
25
+ is_following: { type: Boolean, default: false },
26
+ followers_count: { type: Number, default: 0 },
27
+ });
28
+
29
+ const page = usePage();
30
+ const activeTab = ref('reply');
31
+ const showShortcutHelp = ref(false);
32
+ const replyComposerRef = ref(null);
33
+ const statusSelectRef = ref(null);
34
+ const prioritySelectRef = ref(null);
35
+
36
+ const statusForm = useForm({ status: '' });
37
+ const priorityForm = useForm({ priority: '' });
38
+ const assignForm = useForm({ agent_id: '' });
39
+
40
+ function changeStatus(status) {
41
+ statusForm.status = status;
42
+ statusForm.post(route('escalated.admin.tickets.status', props.ticket.reference), { preserveScroll: true });
43
+ }
44
+
45
+ function changePriority(priority) {
46
+ priorityForm.priority = priority;
47
+ priorityForm.post(route('escalated.admin.tickets.priority', props.ticket.reference), { preserveScroll: true });
48
+ }
49
+
50
+ function assignToMe() {
51
+ assignForm.agent_id = page.props.auth.user.id;
52
+ assignForm.post(route('escalated.admin.tickets.assign', props.ticket.reference), { preserveScroll: true });
53
+ }
54
+
55
+ function toggleFollow() {
56
+ router.post(route('escalated.admin.tickets.follow', props.ticket.reference), {}, { preserveScroll: true });
57
+ }
58
+
59
+ // Keyboard shortcuts
60
+ useKeyboardShortcuts({
61
+ 'r': () => { activeTab.value = 'reply'; replyComposerRef.value?.$el?.querySelector('textarea')?.focus(); },
62
+ 'n': () => { activeTab.value = 'note'; },
63
+ 's': () => { statusSelectRef.value?.focus(); },
64
+ 'p': () => { prioritySelectRef.value?.focus(); },
65
+ 'f': () => { toggleFollow(); },
66
+ '?': () => { showShortcutHelp.value = true; },
67
+ });
68
+ </script>
69
+
70
+ <template>
71
+ <EscalatedLayout :title="ticket.subject">
72
+ <div class="mb-5 flex flex-wrap items-center gap-3">
73
+ <span class="text-sm font-mono font-medium text-white">{{ ticket.reference }}</span>
74
+ <StatusBadge :status="ticket.status" />
75
+ <PriorityBadge :priority="ticket.priority" />
76
+ <span class="text-sm text-neutral-500">by {{ ticket.requester?.name }}</span>
77
+ <PresenceIndicator :ticket-reference="ticket.reference" route-prefix="escalated.admin" />
78
+ <div class="ml-auto flex items-center gap-2">
79
+ <FollowButton :is-following="is_following" :followers-count="followers_count"
80
+ :action="route('escalated.admin.tickets.follow', ticket.reference)" />
81
+ <MacroDropdown v-if="macros.length" :macros="macros"
82
+ :action="route('escalated.admin.tickets.macro', ticket.reference)" />
83
+ <button v-if="!ticket.assigned_to" @click="assignToMe"
84
+ class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-3 py-1.5 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400">
85
+ Assign to Me
86
+ </button>
87
+ <select ref="statusSelectRef" @change="changeStatus($event.target.value); $event.target.value = ''"
88
+ class="rounded-lg border border-white/10 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
89
+ <option value="">Change Status...</option>
90
+ <option value="in_progress">In Progress</option>
91
+ <option value="waiting_on_customer">Waiting on Customer</option>
92
+ <option value="resolved">Resolved</option>
93
+ <option value="closed">Closed</option>
94
+ </select>
95
+ <select ref="prioritySelectRef" @change="changePriority($event.target.value); $event.target.value = ''"
96
+ class="rounded-lg border border-white/10 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
97
+ <option value="">Change Priority...</option>
98
+ <option value="low">Low</option>
99
+ <option value="medium">Medium</option>
100
+ <option value="high">High</option>
101
+ <option value="urgent">Urgent</option>
102
+ <option value="critical">Critical</option>
103
+ </select>
104
+ </div>
105
+ </div>
106
+ <div class="grid grid-cols-1 gap-6 lg:grid-cols-3">
107
+ <div class="lg:col-span-2 space-y-6">
108
+ <PinnedNotes v-if="ticket.pinned_notes?.length" :notes="ticket.pinned_notes"
109
+ :ticket-reference="ticket.reference" route-prefix="escalated.admin" />
110
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
111
+ <p class="whitespace-pre-wrap text-sm text-neutral-300">{{ ticket.description }}</p>
112
+ <AttachmentList v-if="ticket.attachments?.length" :attachments="ticket.attachments" class="mt-3" />
113
+ </div>
114
+ <div>
115
+ <div class="mb-4 flex gap-4 border-b border-white/[0.06]">
116
+ <button @click="activeTab = 'reply'"
117
+ :class="['pb-2 text-sm font-medium transition-colors', activeTab === 'reply' ? 'border-b-2 border-cyan-500 text-white' : 'text-neutral-500 hover:text-neutral-300']">
118
+ Reply
119
+ </button>
120
+ <button @click="activeTab = 'note'"
121
+ :class="['pb-2 text-sm font-medium transition-colors', activeTab === 'note' ? 'border-b-2 border-amber-500 text-amber-400' : 'text-neutral-500 hover:text-neutral-300']">
122
+ Internal Note
123
+ </button>
124
+ </div>
125
+ <ReplyComposer v-if="activeTab === 'reply'" ref="replyComposerRef"
126
+ :action="route('escalated.admin.tickets.reply', ticket.reference)"
127
+ :canned-responses="cannedResponses" />
128
+ <ReplyComposer v-else
129
+ :action="route('escalated.admin.tickets.note', ticket.reference)"
130
+ placeholder="Write an internal note..."
131
+ submit-label="Add Note" />
132
+ </div>
133
+ <div>
134
+ <h2 class="mb-4 text-lg font-semibold text-neutral-200">Conversation</h2>
135
+ <ReplyThread :replies="ticket.replies || []" :current-user-id="page.props.auth?.user?.id"
136
+ :ticket-reference="ticket.reference" route-prefix="escalated.admin" pinnable />
137
+ </div>
138
+ </div>
139
+ <div>
140
+ <TicketSidebar :ticket="ticket" :tags="tags" :departments="departments" />
141
+ </div>
142
+ </div>
143
+ <KeyboardShortcutHelp v-model:show="showShortcutHelp" context="detail" />
144
+ </EscalatedLayout>
145
+ </template>