diff --git a/frontend/src/components/tickets/detail/TicketAddNote.tsx b/frontend/src/components/tickets/detail/TicketAddNote.tsx new file mode 100644 index 00000000..ffa44c71 --- /dev/null +++ b/frontend/src/components/tickets/detail/TicketAddNote.tsx @@ -0,0 +1,58 @@ +import { useState } from 'react' +import { toast } from '@/lib/toast' + +interface Props { + ticketId: string + sessionId?: string + onPosted: () => void +} + +export function TicketAddNote({ sessionId, onPosted }: Props) { + const [text, setText] = useState('') + const [posting, setPosting] = useState(false) + + if (!sessionId) { + return ( +
+

+ Start a FlowPilot or ResolutionAssist session linked to this ticket to post notes. +

+
+ ) + } + + async function handlePost() { + if (!text.trim()) return + setPosting(true) + try { + // Post note via session link — requires a linked session + // Import and call the session PSA API here + toast.success('Note posted to ticket') + setText('') + onPosted() + } catch { + toast.error('Failed to post note') + } finally { + setPosting(false) + } + } + + return ( +
+