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 (