diff --git a/app/mobile/tickets/[id]/page.tsx b/app/mobile/tickets/[id]/page.tsx index 2b1c1c8..5704c5f 100644 --- a/app/mobile/tickets/[id]/page.tsx +++ b/app/mobile/tickets/[id]/page.tsx @@ -4,7 +4,7 @@ import { useEffect, useState, use } from 'react'; import { useRouter } from 'next/navigation'; import { ArrowLeft, RefreshCw, Clock, FileText, Timer, CheckCircle2, - ChevronDown, ChevronRight, User, Briefcase, AlertCircle, EyeOff, Eye, + ChevronDown, ChevronRight, User, Briefcase, AlertCircle, EyeOff, Eye, Mail, } from 'lucide-react'; const PRIORITY_LABEL: Record = { @@ -162,17 +162,19 @@ function TimelineCard({ item, defaultOpen = false }: { item: TimelineItem; defau // note const note = item.data; - const isInternal = note.publish === 1; + const isInternal = note.publish === 2; const isSystem = item.is_system; const bodyNodes = renderContent(note.description ?? ''); const bodyPlain = (note.description ?? '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(); - const iconColor = isSystem ? 'text-muted-foreground' : isInternal ? 'text-slate-400' : 'text-amber-500'; - const iconBg = isSystem ? 'bg-muted' : isInternal ? 'bg-muted' : 'bg-amber-500/10'; + const isEmail = note.note_type === 2; + const iconColor = isSystem ? 'text-muted-foreground' : isInternal ? 'text-slate-400' : isEmail ? 'text-violet-500' : 'text-amber-500'; + const iconBg = isSystem ? 'bg-muted' : isInternal ? 'bg-muted' : isEmail ? 'bg-violet-500/10' : 'bg-amber-500/10'; + const NoteIcon = isEmail ? Mail : FileText; return (
- +
@@ -209,6 +211,7 @@ export default function TicketTimeline({ params }: { params: Promise<{ id: strin const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [showSystem, setShowSystem] = useState(false); + const [showInternal, setShowInternal] = useState(false); useEffect(() => { setLoading(true); @@ -280,20 +283,33 @@ export default function TicketTimeline({ params }: { params: Promise<{ id: strin {/* Timeline */}
-
+

Timeline

- +
+ + +
{timeline.length === 0 ? (

No activity recorded

) : ( timeline - .filter(item => showSystem || item.kind !== 'note' || !item.is_system) + .filter(item => { + if (item.kind !== 'note') return true; + if (!showSystem && item.is_system) return false; + if (!showInternal && (item.data as any).publish === 2) return false; + return true; + }) .map((item, i) => ( ))