File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/home/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,19 +36,29 @@ export function ChatMessageAttachments(props: {
3636 )
3737 }
3838 const isVideo = att . media_type . startsWith ( 'video/' )
39- return (
40- < div key = { att . id } className = 'h-[56px] w-[56px] overflow-hidden rounded-[8px]' >
41- { isVideo ? (
39+ if ( isVideo ) {
40+ const Icon = getDocumentIcon ( att . media_type , att . filename )
41+ return (
42+ < div
43+ key = { att . id }
44+ className = 'relative h-[56px] w-[56px] overflow-hidden rounded-[8px] bg-[var(--surface-5)]'
45+ >
46+ < div className = 'absolute inset-0 flex items-center justify-center text-[var(--text-icon)]' >
47+ < Icon className = 'h-[18px] w-[18px]' />
48+ </ div >
4249 < video
4350 src = { att . previewUrl }
4451 muted
4552 playsInline
4653 preload = 'metadata'
47- className = 'h-full w-full object-cover'
54+ className = 'relative h-full w-full object-cover'
4855 />
49- ) : (
50- < img src = { att . previewUrl } alt = { att . filename } className = 'h-full w-full object-cover' />
51- ) }
56+ </ div >
57+ )
58+ }
59+ return (
60+ < div key = { att . id } className = 'h-[56px] w-[56px] overflow-hidden rounded-[8px]' >
61+ < img src = { att . previewUrl } alt = { att . filename } className = 'h-full w-full object-cover' />
5262 </ div >
5363 )
5464 } ) }
Original file line number Diff line number Diff line change @@ -32,13 +32,21 @@ export const AttachedFilesList = React.memo(function AttachedFilesList({
3232 onClick = { ( ) => onFileClick ( file ) }
3333 >
3434 { hasPreview && isVideo ? (
35- < video
36- src = { file . previewUrl }
37- muted
38- playsInline
39- preload = 'metadata'
40- className = 'h-full w-full object-cover'
41- />
35+ < >
36+ < div className = 'absolute inset-0 flex items-center justify-center text-[var(--text-icon)]' >
37+ { ( ( ) => {
38+ const Icon = getDocumentIcon ( file . type , file . name )
39+ return < Icon className = 'h-[18px] w-[18px]' />
40+ } ) ( ) }
41+ </ div >
42+ < video
43+ src = { file . previewUrl }
44+ muted
45+ playsInline
46+ preload = 'metadata'
47+ className = 'relative h-full w-full object-cover'
48+ />
49+ </ >
4250 ) : hasPreview ? (
4351 < img
4452 src = { file . previewUrl }
You can’t perform that action at this time.
0 commit comments