// End of third-party imports import { compact } from 'lodash' import { FileCode, Plus, X } from 'lucide-react' import { useCallback, useEffect, useMemo, useRef, useState, type ChangeEvent, type RefObject, } from 'react' import { toast } from 'sonner' import { cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui' import { createSupportStorageClient } from './support-storage-client' import { InlineLink } from '@/components/ui/InlineLink' import { useGenerateAttachmentURLsMutation } from '@/data/support/generate-attachment-urls-mutation' import { uuidv4 } from '@/lib/helpers' import { useProfile } from '@/lib/profile' const MAX_ATTACHMENTS = 5 const removeAttachmentButtonClassName = cn( 'absolute -top-1 -right-1 size-4 shrink-0 rounded-full bg-red-900 p-0 cursor-pointer', 'focus-ring' ) const RemoveAttachmentIcon = () => (