@@ -45,6 +45,7 @@ import {
4545 ActionBar ,
4646 AddDocumentsModal ,
4747 BaseTagsModal ,
48+ DocumentTagsCell ,
4849} from '@/app/workspace/[workspaceId]/knowledge/[id]/components'
4950import { getDocumentIcon } from '@/app/workspace/[workspaceId]/knowledge/components'
5051import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
@@ -53,6 +54,7 @@ import {
5354 useKnowledgeBaseDocuments ,
5455 useKnowledgeBasesList ,
5556} from '@/hooks/use-knowledge'
57+ import { useKnowledgeBaseTagDefinitions } from '@/hooks/use-knowledge-base-tag-definitions'
5658import type { DocumentData } from '@/stores/knowledge/store'
5759
5860const logger = createLogger ( 'KnowledgeBase' )
@@ -83,18 +85,17 @@ function DocumentTableRowSkeleton() {
8385 < Skeleton className = 'h-[15px] w-[24px]' />
8486 </ TableCell >
8587 < TableCell className = 'px-[12px] py-[8px]' >
86- < div className = 'flex flex-col justify-center' >
87- < div className = 'flex items-center font-medium text-[12px]' >
88- < Skeleton className = 'h-[15px] w-[50px]' />
89- < span className = 'mx-[6px] hidden text-[var(--text-muted)] xl:inline' > |</ span >
90- < Skeleton className = 'hidden h-[15px] w-[70px] xl:inline-block' />
91- </ div >
92- < Skeleton className = 'mt-[2px] h-[15px] w-[40px] lg:hidden' />
93- </ div >
88+ < Skeleton className = 'h-[15px] w-[60px]' />
9489 </ TableCell >
9590 < TableCell className = 'px-[12px] py-[8px]' >
9691 < Skeleton className = 'h-[24px] w-[64px] rounded-md' />
9792 </ TableCell >
93+ < TableCell className = 'px-[12px] py-[8px]' >
94+ < div className = 'flex items-center gap-[4px]' >
95+ < Skeleton className = 'h-[18px] w-[40px] rounded-full' />
96+ < Skeleton className = 'h-[18px] w-[40px] rounded-full' />
97+ </ div >
98+ </ TableCell >
9899 < TableCell className = 'py-[8px] pr-[4px] pl-[12px]' >
99100 < div className = 'flex items-center gap-[4px]' >
100101 < Skeleton className = 'h-[28px] w-[28px] rounded-[4px]' />
@@ -127,13 +128,16 @@ function DocumentTableSkeleton({ rowCount = 5 }: { rowCount?: number }) {
127128 < TableHead className = 'hidden w-[8%] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)] lg:table-cell' >
128129 Chunks
129130 </ TableHead >
130- < TableHead className = 'w-[16 %] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
131+ < TableHead className = 'w-[11 %] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
131132 Uploaded
132133 </ TableHead >
133- < TableHead className = 'w-[12 %] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
134+ < TableHead className = 'w-[10 %] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
134135 Status
135136 </ TableHead >
136- < TableHead className = 'w-[14%] py-[8px] pr-[4px] pl-[12px] text-[12px] text-[var(--text-secondary)]' >
137+ < TableHead className = 'w-[12%] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
138+ Tags
139+ </ TableHead >
140+ < TableHead className = 'w-[11%] py-[8px] pr-[4px] pl-[12px] text-[12px] text-[var(--text-secondary)]' >
137141 Actions
138142 </ TableHead >
139143 </ TableRow >
@@ -379,6 +383,8 @@ export function KnowledgeBase({
379383 sortOrder,
380384 } )
381385
386+ const { tagDefinitions } = useKnowledgeBaseTagDefinitions ( id )
387+
382388 const router = useRouter ( )
383389
384390 const knowledgeBaseName = knowledgeBase ?. name || passedKnowledgeBaseName || 'Knowledge Base'
@@ -1061,9 +1067,12 @@ export function KnowledgeBase({
10611067 { renderSortableHeader ( 'fileSize' , 'Size' , 'w-[8%]' ) }
10621068 { renderSortableHeader ( 'tokenCount' , 'Tokens' , 'w-[8%]' ) }
10631069 { renderSortableHeader ( 'chunkCount' , 'Chunks' , 'hidden w-[8%] lg:table-cell' ) }
1064- { renderSortableHeader ( 'uploadedAt' , 'Uploaded' , 'w-[16%]' ) }
1065- { renderSortableHeader ( 'processingStatus' , 'Status' , 'w-[12%]' ) }
1066- < TableHead className = 'w-[14%] py-[8px] pr-[4px] pl-[12px] text-[12px] text-[var(--text-secondary)]' >
1070+ { renderSortableHeader ( 'uploadedAt' , 'Uploaded' , 'w-[11%]' ) }
1071+ { renderSortableHeader ( 'processingStatus' , 'Status' , 'w-[10%]' ) }
1072+ < TableHead className = 'w-[12%] px-[12px] py-[8px] text-[12px] text-[var(--text-secondary)]' >
1073+ Tags
1074+ </ TableHead >
1075+ < TableHead className = 'w-[11%] py-[8px] pr-[4px] pl-[12px] text-[12px] text-[var(--text-secondary)]' >
10671076 Actions
10681077 </ TableHead >
10691078 </ TableRow >
@@ -1135,20 +1144,16 @@ export function KnowledgeBase({
11351144 : '—' }
11361145 </ TableCell >
11371146 < TableCell className = 'px-[12px] py-[8px]' >
1138- < div className = 'flex flex-col justify-center' >
1139- < div className = 'flex items-center font-medium text-[12px]' >
1140- < span > { format ( new Date ( doc . uploadedAt ) , 'h:mm a' ) } </ span >
1141- < span className = 'mx-[6px] hidden text-[var(--text-muted)] xl:inline' >
1142- |
1143- </ span >
1144- < span className = 'hidden text-[var(--text-muted)] xl:inline' >
1145- { format ( new Date ( doc . uploadedAt ) , 'MMM d, yyyy' ) }
1147+ < Tooltip . Root >
1148+ < Tooltip . Trigger asChild >
1149+ < span className = 'text-[12px] text-[var(--text-muted)]' >
1150+ { format ( new Date ( doc . uploadedAt ) , 'MMM d' ) }
11461151 </ span >
1147- </ div >
1148- < div className = 'mt-[2px] text-[12px] text-[var(--text-muted)] lg:hidden '>
1149- { format ( new Date ( doc . uploadedAt ) , 'MMM d' ) }
1150- </ div >
1151- </ div >
1152+ </ Tooltip . Trigger >
1153+ < Tooltip . Content side = 'top '>
1154+ { format ( new Date ( doc . uploadedAt ) , 'MMM d, yyyy h:mm a ' ) }
1155+ </ Tooltip . Content >
1156+ </ Tooltip . Root >
11521157 </ TableCell >
11531158 < TableCell className = 'px-[12px] py-[8px]' >
11541159 { doc . processingStatus === 'failed' && doc . processingError ? (
@@ -1166,6 +1171,9 @@ export function KnowledgeBase({
11661171 < div className = { statusDisplay . className } > { statusDisplay . text } </ div >
11671172 ) }
11681173 </ TableCell >
1174+ < TableCell className = 'px-[12px] py-[8px]' >
1175+ < DocumentTagsCell document = { doc } tagDefinitions = { tagDefinitions } />
1176+ </ TableCell >
11691177 < TableCell className = 'py-[8px] pr-[4px] pl-[12px]' >
11701178 < div className = 'flex items-center gap-[4px]' >
11711179 { doc . processingStatus === 'failed' && (
0 commit comments