@@ -7,10 +7,7 @@ import {
77} from './AttachmentActions' ;
88import { AudioProps , Audio as DefaultAudio } from './Audio' ;
99import { CardProps , Card as DefaultCard } from './Card' ;
10- import {
11- FileAttachment as DefaultFile ,
12- FileAttachmentProps ,
13- } from './FileAttachment' ;
10+ import { FileAttachment as DefaultFile , FileAttachmentProps } from './FileAttachment' ;
1411import {
1512 isAudioAttachment ,
1613 isFileAttachment ,
@@ -38,9 +35,7 @@ import type { ActionHandlerReturnType } from '../Message';
3835
3936import type { DefaultAttachmentType } from '../../../types/types' ;
4037
41- export type AttachmentProps <
42- At extends DefaultAttachmentType = DefaultAttachmentType
43- > = {
38+ export type AttachmentProps < At extends DefaultAttachmentType = DefaultAttachmentType > = {
4439 /**
4540 * The attachment to render.
4641 * See [Attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript)
@@ -93,13 +88,7 @@ export type DefaultAttachmentProps<
9388> = Required <
9489 Pick <
9590 InnerAttachmentUIComponentProps ,
96- | 'AttachmentActions'
97- | 'Audio'
98- | 'Card'
99- | 'File'
100- | 'Gallery'
101- | 'Image'
102- | 'Media'
91+ 'AttachmentActions' | 'Audio' | 'Card' | 'File' | 'Gallery' | 'Image' | 'Media'
10392 >
10493> & {
10594 attachment : ExtendedAttachment < At > ;
@@ -137,9 +126,7 @@ export type InnerAttachmentUIComponentProps<
137126 *
138127 * @example ./Attachment.md
139128 */
140- export const Attachment = <
141- At extends DefaultAttachmentType = DefaultAttachmentType
142- > (
129+ export const Attachment = < At extends DefaultAttachmentType = DefaultAttachmentType > (
143130 props : AttachmentProps < At > ,
144131) => {
145132 const {
@@ -157,8 +144,7 @@ export const Attachment = <
157144 const gallery = {
158145 images : attachments ?. filter (
159146 ( attachment ) =>
160- attachment . type === 'image' &&
161- ! ( attachment . og_scrape_url || attachment . title_link ) ,
147+ attachment . type === 'image' && ! ( attachment . og_scrape_url || attachment . title_link ) ,
162148 ) ,
163149 type : 'gallery' ,
164150 } ;
@@ -169,10 +155,7 @@ export const Attachment = <
169155 newAttachments = [
170156 ...attachments . filter (
171157 ( attachment ) =>
172- ! (
173- attachment . type === 'image' &&
174- ! ( attachment . og_scrape_url || attachment . title_link )
175- ) ,
158+ ! ( attachment . type === 'image' && ! ( attachment . og_scrape_url || attachment . title_link ) ) ,
176159 ) ,
177160 gallery ,
178161 ] ;
0 commit comments