11import React , { useMemo } from 'react' ;
2- import type { SharedLocationResponse , Attachment as StreamAttachment } from 'stream-chat' ;
2+ import type { SharedLocationResponseData , Attachment as StreamAttachment } from 'stream-chat' ;
33import {
44 isAudioAttachment ,
55 isFileAttachment ,
66 isImageAttachment ,
77 isScrapedContent ,
8- isSharedLocationResponse ,
8+ isSharedLocationResponseData ,
99 isVideoAttachment ,
1010 isVoiceRecordingAttachment ,
1111} from 'stream-chat' ;
@@ -29,7 +29,6 @@ import type { AudioProps } from './Audio';
2929import type { VoiceRecordingProps } from './VoiceRecording' ;
3030import type { CardProps } from './LinkPreview/Card' ;
3131import type { FileAttachmentProps } from './FileAttachment' ;
32- import type { GalleryItem } from '../Gallery' ;
3332import type { UnsupportedAttachmentProps } from './UnsupportedAttachment' ;
3433import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler' ;
3534import type { GeolocationProps } from './Geolocation' ;
@@ -49,7 +48,7 @@ export const ATTACHMENT_GROUPS_ORDER = [
4948
5049export type AttachmentProps = {
5150 /** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/
52- attachments : ( StreamAttachment | SharedLocationResponse ) [ ] ;
51+ attachments : ( StreamAttachment | SharedLocationResponseData ) [ ] ;
5352 /** The handler function to call when an action is performed on an attachment, examples include canceling a \/giphy command or shuffling the results. */
5453 actionHandler ?: ActionHandlerReturnType ;
5554 /**
@@ -120,10 +119,10 @@ const renderGroupedAttachments = ({
120119 attachments,
121120 ...rest
122121} : AttachmentProps ) : GroupedRenderedAttachment => {
123- const mediaAttachments : GalleryItem [ ] = [ ] ;
122+ const mediaAttachments : StreamAttachment [ ] = [ ] ;
124123 const containers = attachments . reduce < GroupedRenderedAttachment > (
125124 ( typeMap , attachment ) => {
126- if ( isSharedLocationResponse ( attachment ) ) {
125+ if ( isSharedLocationResponseData ( attachment ) ) {
127126 typeMap . geolocation . push (
128127 < GeolocationContainer
129128 { ...rest }
@@ -151,7 +150,7 @@ const renderGroupedAttachments = ({
151150 isImageAttachment ( attachment ) ||
152151 isVideoAttachment ( attachment , SUPPORTED_VIDEO_FORMATS )
153152 ) {
154- mediaAttachments . push ( attachment as GalleryItem ) ;
153+ mediaAttachments . push ( attachment ) ;
155154 } else if (
156155 isAudioAttachment ( attachment ) ||
157156 isVoiceRecordingAttachment ( attachment ) ||
0 commit comments