'use client' import { useCallback, useState } from 'react' import { Button } from './../ui/button' import { Textarea } from './../ui/textarea' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './../ui/alert-dialog' import { ChatInput } from './../chat/chat-input' import { ChatAttachmentAddButton, ChatAttachmentChipStrip, } from './../chat/chat-attachment-bar' import { useChatAttachments } from './../chat/hooks/use-chat-attachments' import type { AnyTicket } from './types' import { TICKET_TEXT_MAX_CHARS } from './types' import type { TicketDetailDrawerProps, TicketRef } from './ticket-detail-drawer' export interface TicketReplyComposerProps { ticket: AnyTicket busy: boolean supportSystemDown: boolean onSendMessage: TicketDetailDrawerProps['onSendMessage'] onClose: TicketDetailDrawerProps['onClose'] } /** * Open-ticket reply composer — REUSES the exact same layout as the global * Ask-AI chat composer (`embeddable-chat.tsx`): the shared `` with * the staged-file chip strip above it and the attachment `+` button in a * controls row BELOW the input (identical placement to the global chat), plus * the destructive close-confirm `AlertDialog`. * * Replaces the former `OpenActions` raw-`