{"version":3,"file":"AttachmentContext.mjs","names":[],"sources":["../../../src/context/AttachmentContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { GiphyVersions } from 'stream-chat';\nimport type {\n  ImageAttachmentSizeHandler,\n  VideoAttachmentSizeHandler,\n} from '../components/Attachment/Attachment';\nimport {\n  getImageAttachmentConfiguration,\n  getVideoAttachmentConfiguration,\n} from '../components/Attachment/attachment-sizing';\n\nexport type ImageAttachmentConfiguration = {\n  url: string;\n};\nexport type VideoAttachmentConfiguration = ImageAttachmentConfiguration & {\n  thumbUrl?: string;\n};\n\nexport type AttachmentContextValue = {\n  giphyVersion: GiphyVersions;\n  imageAttachmentSizeHandler: ImageAttachmentSizeHandler;\n  shouldGenerateVideoThumbnail: boolean;\n  videoAttachmentSizeHandler: VideoAttachmentSizeHandler;\n};\n\nexport const defaultAttachmentContextValue: AttachmentContextValue = {\n  giphyVersion: 'fixed_height',\n  imageAttachmentSizeHandler: getImageAttachmentConfiguration,\n  shouldGenerateVideoThumbnail: true,\n  videoAttachmentSizeHandler: getVideoAttachmentConfiguration,\n};\n\nconst AttachmentContext = React.createContext<AttachmentContextValue>(\n  defaultAttachmentContextValue,\n);\n\nexport const AttachmentContextProvider = AttachmentContext.Provider;\n\nexport const useAttachmentContext = () => React.useContext(AttachmentContext);\n"],"mappings":";;;AAyBA,IAAa,gCAAwD;CACnE,cAAc;CACd,4BAA4B;CAC5B,8BAA8B;CAC9B,4BAA4B;AAC9B;AAEA,IAAM,oBAAoB,MAAM,cAC9B,6BACF;AAEA,IAAa,4BAA4B,kBAAkB;AAE3D,IAAa,6BAA6B,MAAM,WAAW,iBAAiB"}