{"version":3,"file":"UnsupportedAttachmentPreview.mjs","names":[],"sources":["../../../../../src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx"],"sourcesContent":["import React from 'react';\nimport type { AnyLocalAttachment, LocalUploadAttachment } from 'stream-chat';\nimport { useComponentContextIcons, useTranslationContext } from '../../../context';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\n\nexport type UnsupportedAttachmentPreviewProps<\n  CustomLocalMetadata = Record<string, unknown>,\n> = {\n  attachment: AnyLocalAttachment<CustomLocalMetadata>;\n  handleRetry: (\n    attachment: LocalUploadAttachment,\n  ) => void | Promise<LocalUploadAttachment | undefined>;\n  removeAttachments: (ids: string[]) => void;\n};\n\nexport const UnsupportedAttachmentPreview = ({\n  attachment,\n  removeAttachments,\n}: UnsupportedAttachmentPreviewProps) => {\n  const { IconUnsupportedAttachment } = useComponentContextIcons();\n  const { t } = useTranslationContext();\n  const { id } = attachment.localMetadata ?? {};\n\n  return (\n    <div\n      className='str-chat__attachment-preview-unsupported'\n      data-testid='attachment-preview-unsupported'\n    >\n      <IconUnsupportedAttachment />\n      <div className='str-chat__attachment-preview-unsupported__metadata'>\n        <div\n          className='str-chat__attachment-preview-unsupported__title'\n          data-testid='unsupported-attachment-preview-title'\n        >\n          {t('common.unsupportedAttachment.text', 'Unsupported attachment')}\n        </div>\n      </div>\n      <RemoveAttachmentPreviewButton\n        data-testid='file-preview-item-delete-button'\n        onClick={() => {\n          if (id) removeAttachments([id]);\n        }}\n      />\n    </div>\n  );\n};\n"],"mappings":";;;;;;AAeA,IAAa,gCAAgC,EAC3C,YACA,wBACuC;CACvC,MAAM,EAAE,8BAA8B,yBAAyB;CAC/D,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,EAAE,OAAO,WAAW,iBAAiB,CAAC;CAE5C,OACE,qBAAC,OAAD;EACE,WAAU;EACV,eAAY;YAFd;GAIE,oBAAC,2BAAD,CAA4B,CAAA;GAC5B,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,OAAD;KACE,WAAU;KACV,eAAY;eAEX,EAAE,qCAAqC,wBAAwB;IAC7D,CAAA;GACF,CAAA;GACL,oBAAC,+BAAD;IACE,eAAY;IACZ,eAAe;KACb,IAAI,IAAI,kBAAkB,CAAC,EAAE,CAAC;IAChC;GACD,CAAA;EACE;;AAET"}