diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/chat-message-attachments.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/chat-message-attachments.tsx index e39d3a0dd37..d430fb14e61 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/chat-message-attachments.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/chat-message-attachments.tsx @@ -30,13 +30,36 @@ export function ChatMessageAttachments(props: { )} > {attachments.map((att) => { - const isImage = att.media_type.startsWith('image/') - return isImage && att.previewUrl ? ( + if (!att.previewUrl) { + return ( + + ) + } + const isVideo = att.media_type.startsWith('video/') + if (isVideo) { + const Icon = getDocumentIcon(att.media_type, att.filename) + return ( +
+
+ +
+
+ ) + } + return (
{att.filename}
- ) : ( - ) })} diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list.tsx index 6046107e6d6..3dc97d208ac 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list.tsx @@ -22,7 +22,8 @@ export const AttachedFilesList = React.memo(function AttachedFilesList({ return (
{attachedFiles.map((file) => { - const isImage = file.type.startsWith('image/') + const isVideo = file.type.startsWith('video/') + const hasPreview = Boolean(file.previewUrl) return ( @@ -30,7 +31,23 @@ export const AttachedFilesList = React.memo(function AttachedFilesList({ className='group relative h-[56px] w-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-5)] hover:bg-[var(--surface-4)]' onClick={() => onFileClick(file)} > - {isImage && file.previewUrl ? ( + {hasPreview && isVideo ? ( + <> +
+ {(() => { + const Icon = getDocumentIcon(file.type, file.name) + return + })()} +
+