@@ -62,64 +62,50 @@ function formatFileSize(bytes: number): string {
6262}
6363
6464const getStatusDisplay = ( doc : DocumentData ) => {
65- const processingStatus = ( ( ) => {
66- switch ( doc . processingStatus ) {
67- case 'pending' :
68- return {
69- text : 'Pending' ,
70- className :
71- 'inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300' ,
72- }
73- case 'processing' :
74- return {
75- text : (
76- < >
77- < Loader2 className = 'mr-1.5 h-3 w-3 animate-spin' />
78- Processing
79- </ >
80- ) ,
81- className :
82- 'inline-flex items-center rounded-md bg-blue-100 px-2 py-1 text-xs font-medium text-blue-700 dark:bg-blue-900/30 dark:text-blue-300' ,
83- }
84- case 'completed' :
85- return {
86- text : 'Completed' ,
87- className :
88- 'inline-flex items-center rounded-md bg-green-100 px-2 py-1 text-xs font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400' ,
89- }
90- case 'failed' :
91- return {
92- text : 'Failed' ,
93- className :
94- 'inline-flex items-center rounded-md bg-red-100 px-2 py-1 text-xs font-medium text-red-700 dark:bg-red-900/30 dark:text-red-300' ,
95- }
96- default :
97- return {
98- text : 'Unknown' ,
99- className :
100- 'inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300' ,
101- }
102- }
103- } ) ( )
104-
105- const activeStatus = ( ( ) => {
106- if ( doc . processingStatus === 'completed' ) {
65+ // Consolidated status: show processing status when not completed, otherwise show enabled/disabled
66+ switch ( doc . processingStatus ) {
67+ case 'pending' :
68+ return {
69+ text : 'Pending' ,
70+ className :
71+ 'inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300' ,
72+ }
73+ case 'processing' :
74+ return {
75+ text : (
76+ < >
77+ < Loader2 className = 'mr-1.5 h-3 w-3 animate-spin' />
78+ Processing
79+ </ >
80+ ) ,
81+ className :
82+ 'inline-flex items-center rounded-md bg-[#701FFC]/10 px-2 py-1 text-xs font-medium text-[#701FFC] dark:bg-[#701FFC]/20 dark:text-[#8B5FFF]' ,
83+ }
84+ case 'failed' :
85+ return {
86+ text : 'Failed' ,
87+ className :
88+ 'inline-flex items-center rounded-md bg-red-100 px-2 py-1 text-xs font-medium text-red-700 dark:bg-red-900/30 dark:text-red-300' ,
89+ }
90+ case 'completed' :
10791 return doc . enabled
10892 ? {
10993 text : 'Enabled' ,
11094 className :
111- 'inline-flex items-center rounded-md bg-emerald -100 px-2 py-1 text-xs font-medium text-emerald -700 dark:bg-emerald -900/30 dark:text-emerald -400' ,
95+ 'inline-flex items-center rounded-md bg-green -100 px-2 py-1 text-xs font-medium text-green -700 dark:bg-green -900/30 dark:text-green -400' ,
11296 }
11397 : {
11498 text : 'Disabled' ,
11599 className :
116100 'inline-flex items-center rounded-md bg-orange-100 px-2 py-1 text-xs font-medium text-orange-700 dark:bg-orange-900/30 dark:text-orange-400' ,
117101 }
118- }
119- return null
120- } ) ( )
121-
122- return { processingStatus, activeStatus }
102+ default :
103+ return {
104+ text : 'Unknown' ,
105+ className :
106+ 'inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300' ,
107+ }
108+ }
123109}
124110
125111const getProcessingTime = ( doc : DocumentData ) => {
@@ -583,9 +569,9 @@ export function KnowledgeBase({
583569 onClick = { handleAddDocuments }
584570 disabled = { isUploading }
585571 size = 'sm'
586- className = 'mt-1 mr -1 bg-[#701FFC] font-[480] text-primary-foreground shadow-[0_0_0_0_#701FFC] transition-all duration-200 hover:bg-[#6518E6] hover:shadow-[0_0_0_3px_rgba(127,47,255,0.12)]'
572+ className = 'flex items-center gap -1 bg-[#701FFC] font-[480] text-primary-foreground shadow-[0_0_0_0_#701FFC] transition-all duration-200 hover:bg-[#6518E6] hover:shadow-[0_0_0_3px_rgba(127,47,255,0.12)]'
587573 >
588- < Plus className = 'mr-1.5 h-3.5 w-3.5' />
574+ < Plus className = 'h-3.5 w-3.5' />
589575 { isUploading ? 'Uploading...' : 'Add Documents' }
590576 </ Button >
591577 </ div >
@@ -602,17 +588,16 @@ export function KnowledgeBase({
602588 < div className = 'flex flex-1 flex-col overflow-hidden' >
603589 { /* Table header - fixed */ }
604590 < div className = 'sticky top-0 z-10 overflow-x-auto border-b bg-background' >
605- < table className = 'w-full min-w-[800px ] table-fixed' >
591+ < table className = 'w-full min-w-[700px ] table-fixed' >
606592 < colgroup >
607593 < col className = 'w-[4%]' />
608- < col className = { `${ isSidebarCollapsed ? 'w-[20 %]' : 'w-[22 %]' } ` } />
594+ < col className = { `${ isSidebarCollapsed ? 'w-[22 %]' : 'w-[24 %]' } ` } />
609595 < col className = 'w-[8%]' />
610596 < col className = 'w-[8%]' />
611597 < col className = 'hidden w-[8%] lg:table-column' />
612- < col className = { `${ isSidebarCollapsed ? 'w-[16%]' : 'w-[14%]' } ` } />
613- < col className = 'w-[10%]' />
614- < col className = 'w-[10%]' />
598+ < col className = { `${ isSidebarCollapsed ? 'w-[18%]' : 'w-[16%]' } ` } />
615599 < col className = 'w-[12%]' />
600+ < col className = 'w-[14%]' />
616601 </ colgroup >
617602 < thead >
618603 < tr >
@@ -641,11 +626,6 @@ export function KnowledgeBase({
641626 Uploaded
642627 </ span >
643628 </ th >
644- < th className = 'px-4 pt-2 pb-3 text-left font-medium' >
645- < span className = 'text-muted-foreground text-xs leading-none' >
646- Processing
647- </ span >
648- </ th >
649629 < th className = 'px-4 pt-2 pb-3 text-left font-medium' >
650630 < span className = 'text-muted-foreground text-xs leading-none' > Status</ span >
651631 </ th >
@@ -661,17 +641,16 @@ export function KnowledgeBase({
661641
662642 { /* Table body - scrollable */ }
663643 < div className = 'flex-1 overflow-auto' >
664- < table className = 'w-full min-w-[800px ] table-fixed' >
644+ < table className = 'w-full min-w-[700px ] table-fixed' >
665645 < colgroup >
666646 < col className = 'w-[4%]' />
667- < col className = { `${ isSidebarCollapsed ? 'w-[20 %]' : 'w-[22 %]' } ` } />
647+ < col className = { `${ isSidebarCollapsed ? 'w-[22 %]' : 'w-[24 %]' } ` } />
668648 < col className = 'w-[8%]' />
669649 < col className = 'w-[8%]' />
670650 < col className = 'hidden w-[8%] lg:table-column' />
671- < col className = { `${ isSidebarCollapsed ? 'w-[16%]' : 'w-[14%]' } ` } />
672- < col className = 'w-[10%]' />
673- < col className = 'w-[10%]' />
651+ < col className = { `${ isSidebarCollapsed ? 'w-[18%]' : 'w-[16%]' } ` } />
674652 < col className = 'w-[12%]' />
653+ < col className = 'w-[14%]' />
675654 </ colgroup >
676655 < tbody >
677656 { filteredDocuments . length === 0 && ! isLoadingDocuments ? (
@@ -713,11 +692,6 @@ export function KnowledgeBase({
713692 < div className = 'text-muted-foreground text-xs' > —</ div >
714693 </ td >
715694
716- { /* Processing column */ }
717- < td className = 'px-4 py-3' >
718- < div className = 'text-muted-foreground text-xs' > —</ div >
719- </ td >
720-
721695 { /* Status column */ }
722696 < td className = 'px-4 py-3' >
723697 < div className = 'text-muted-foreground text-xs' > —</ div >
@@ -752,9 +726,6 @@ export function KnowledgeBase({
752726 < td className = 'px-4 py-3' >
753727 < div className = 'h-4 w-16 animate-pulse rounded bg-muted' />
754728 </ td >
755- < td className = 'px-4 py-3' >
756- < div className = 'h-4 w-12 animate-pulse rounded bg-muted' />
757- </ td >
758729 < td className = 'px-4 py-3' >
759730 < div className = 'h-4 w-20 animate-pulse rounded bg-muted' />
760731 </ td >
@@ -764,7 +735,7 @@ export function KnowledgeBase({
764735 filteredDocuments . map ( ( doc , index ) => {
765736 const isSelected = selectedDocuments . has ( doc . id )
766737 const statusDisplay = getStatusDisplay ( doc )
767- const processingTime = getProcessingTime ( doc )
738+ // const processingTime = getProcessingTime(doc)
768739
769740 return (
770741 < tr
@@ -859,22 +830,9 @@ export function KnowledgeBase({
859830 </ div >
860831 </ td >
861832
862- { /* Processing column */ }
863- < td className = 'px-4 py-3' >
864- < div className = { statusDisplay . processingStatus . className } >
865- { statusDisplay . processingStatus . text }
866- </ div >
867- </ td >
868-
869833 { /* Status column */ }
870834 < td className = 'px-4 py-3' >
871- { statusDisplay . activeStatus ? (
872- < div className = { statusDisplay . activeStatus . className } >
873- { statusDisplay . activeStatus . text }
874- </ div >
875- ) : (
876- < div className = 'text-muted-foreground text-xs' > —</ div >
877- ) }
835+ < div className = { statusDisplay . className } > { statusDisplay . text } </ div >
878836 </ td >
879837
880838 { /* Actions column */ }
0 commit comments