@@ -6,6 +6,7 @@ import { X } from 'lucide-react'
66import { useParams } from 'next/navigation'
77import { Button , Combobox } from '@/components/emcn/components'
88import { Progress } from '@/components/ui/progress'
9+ import { cn } from '@/lib/core/utils/cn'
910import type { WorkspaceFileRecord } from '@/lib/uploads/contexts/workspace'
1011import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1112import { useWorkflowStore } from '@/stores/workflows/workflow/store'
@@ -429,14 +430,14 @@ export function FileUpload({
429430 < Button
430431 type = 'button'
431432 variant = 'ghost'
432- className = 'h-6 w-6 shrink-0 p-0'
433+ className = 'h-5 w-5 shrink-0 p-0'
433434 onClick = { ( e ) => handleRemoveFile ( file , e ) }
434435 disabled = { isDeleting }
435436 >
436437 { isDeleting ? (
437- < div className = 'h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
438+ < div className = 'h-3.5 w-3.5 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
438439 ) : (
439- < X className = 'h-4 w-4 ' />
440+ < X className = 'h-3.5 w-3.5 ' />
440441 ) }
441442 </ Button >
442443 </ div >
@@ -453,8 +454,8 @@ export function FileUpload({
453454 < span className = 'text-[var(--text-primary)]' > { file . name } </ span >
454455 < span className = 'ml-2 text-[var(--text-muted)]' > ({ formatFileSize ( file . size ) } )</ span >
455456 </ div >
456- < div className = 'flex h-8 w-8 shrink-0 items-center justify-center' >
457- < div className = 'h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
457+ < div className = 'flex h-5 w-5 shrink-0 items-center justify-center' >
458+ < div className = 'h-3.5 w-3.5 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
458459 </ div >
459460 </ div >
460461 )
@@ -512,72 +513,66 @@ export function FileUpload({
512513 { /* Error message */ }
513514 { uploadError && < div className = 'mb-2 text-red-600 text-sm' > { uploadError } </ div > }
514515
515- < div >
516- { /* File list with consistent spacing */ }
517- { ( hasFiles || isUploading ) && (
518- < div className = 'mb-2 space-y-2' >
519- { /* Only show files that aren't currently uploading */ }
520- { filesArray . map ( ( file ) => {
521- const isCurrentlyUploading = uploadingFiles . some (
522- ( uploadingFile ) => uploadingFile . name === file . name
523- )
524- return ! isCurrentlyUploading && renderFileItem ( file )
525- } ) }
526- { isUploading && (
527- < >
528- { uploadingFiles . map ( renderUploadingItem ) }
529- < div className = 'mt-1' >
530- < Progress
531- value = { uploadProgress }
532- className = 'h-2 w-full'
533- indicatorClassName = 'bg-foreground'
534- />
535- < div className = 'mt-1 text-center text-muted-foreground text-xs' >
536- { uploadProgress < 100 ? 'Uploading...' : 'Upload complete!' }
537- </ div >
516+ { /* File list with consistent spacing */ }
517+ { ( hasFiles || isUploading ) && (
518+ < div className = { cn ( 'space-y-2' , multiple && 'mb-2' ) } >
519+ { /* Only show files that aren't currently uploading */ }
520+ { filesArray . map ( ( file ) => {
521+ const isCurrentlyUploading = uploadingFiles . some (
522+ ( uploadingFile ) => uploadingFile . name === file . name
523+ )
524+ return ! isCurrentlyUploading && renderFileItem ( file )
525+ } ) }
526+ { isUploading && (
527+ < >
528+ { uploadingFiles . map ( renderUploadingItem ) }
529+ < div className = 'mt-1' >
530+ < Progress
531+ value = { uploadProgress }
532+ className = 'h-2 w-full'
533+ indicatorClassName = 'bg-foreground'
534+ />
535+ < div className = 'mt-1 text-center text-muted-foreground text-xs' >
536+ { uploadProgress < 100 ? 'Uploading...' : 'Upload complete!' }
538537 </ div >
539- </ >
540- ) }
541- </ div >
542- ) }
543-
544- { /* Add More dropdown for multiple files */ }
545- { hasFiles && multiple && ! isUploading && (
546- < div >
547- < Combobox
548- options = { comboboxOptions }
549- value = { inputValue }
550- onChange = { handleComboboxChange }
551- onOpenChange = { ( open ) => {
552- if ( open ) void loadWorkspaceFiles ( )
553- } }
554- placeholder = { loadingWorkspaceFiles ? 'Loading files...' : '+ Add More' }
555- disabled = { disabled || loadingWorkspaceFiles }
556- editable = { true }
557- filterOptions = { true }
558- isLoading = { loadingWorkspaceFiles }
559- />
560- </ div >
561- ) }
562- </ div >
538+ </ div >
539+ </ >
540+ ) }
541+ </ div >
542+ ) }
543+
544+ { /* Add More dropdown for multiple files */ }
545+ { hasFiles && multiple && ! isUploading && (
546+ < Combobox
547+ options = { comboboxOptions }
548+ value = { inputValue }
549+ onChange = { handleComboboxChange }
550+ onOpenChange = { ( open ) => {
551+ if ( open ) void loadWorkspaceFiles ( )
552+ } }
553+ placeholder = { loadingWorkspaceFiles ? 'Loading files...' : '+ Add More' }
554+ disabled = { disabled || loadingWorkspaceFiles }
555+ editable = { true }
556+ filterOptions = { true }
557+ isLoading = { loadingWorkspaceFiles }
558+ />
559+ ) }
563560
564561 { /* Show dropdown selector if no files and not uploading */ }
565562 { ! hasFiles && ! isUploading && (
566- < div className = 'flex items-center' >
567- < Combobox
568- options = { comboboxOptions }
569- value = { inputValue }
570- onChange = { handleComboboxChange }
571- onOpenChange = { ( open ) => {
572- if ( open ) void loadWorkspaceFiles ( )
573- } }
574- placeholder = { loadingWorkspaceFiles ? 'Loading files...' : 'Select or upload file' }
575- disabled = { disabled || loadingWorkspaceFiles }
576- editable = { true }
577- filterOptions = { true }
578- isLoading = { loadingWorkspaceFiles }
579- />
580- </ div >
563+ < Combobox
564+ options = { comboboxOptions }
565+ value = { inputValue }
566+ onChange = { handleComboboxChange }
567+ onOpenChange = { ( open ) => {
568+ if ( open ) void loadWorkspaceFiles ( )
569+ } }
570+ placeholder = { loadingWorkspaceFiles ? 'Loading files...' : 'Select or upload file' }
571+ disabled = { disabled || loadingWorkspaceFiles }
572+ editable = { true }
573+ filterOptions = { true }
574+ isLoading = { loadingWorkspaceFiles }
575+ />
581576 ) }
582577 </ div >
583578 )
0 commit comments