@@ -237,9 +237,9 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
237237
238238 // Refactored: Style is embedded within the component
239239 return (
240- < div className = " flex flex-col w-full bg-white border border-gray-200 rounded-md shadow-sm h-full" style = { { height : containerHeight } } >
240+ < div className = { ` flex flex-col w-full bg-white border border-gray-200 rounded-md shadow-sm h-full h-[ ${ containerHeight } ]` } >
241241 { /* Title bar */ }
242- < div className = { `${ LAYOUT . KB_HEADER_PADDING } border-b border-gray-200 flex-shrink-0 flex items-center` } style = { { height : titleBarHeight } } >
242+ < div className = { `${ LAYOUT . KB_HEADER_PADDING } border-b border-gray-200 flex-shrink-0 flex items-center h-[ ${ titleBarHeight } ]` } >
243243 < div className = "flex items-center justify-between w-full" >
244244 < div className = "flex items-center" >
245245 { isCreatingMode ? (
@@ -260,14 +260,8 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
260260 value = { knowledgeBaseName }
261261 onChange = { ( e ) => onNameChange && onNameChange ( e . target . value ) }
262262 placeholder = { t ( 'document.input.knowledgeBaseName' ) }
263- className = { `${ LAYOUT . KB_TITLE_MARGIN } ` }
263+ className = { `${ LAYOUT . KB_TITLE_MARGIN } w-[320px] font-medium my-[2px] ` }
264264 size = "large"
265- style = { {
266- width : '320px' ,
267- fontWeight : 500 ,
268- marginTop : '2px' ,
269- marginBottom : '2px'
270- } }
271265 prefix = { < span className = "text-blue-600" > 📚</ span > }
272266 autoFocus
273267 disabled = { hasDocuments || isUploading || docState . isLoadingDocuments } // Disable editing name if there are documents or uploading
@@ -294,11 +288,17 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
294288 </ div >
295289
296290 { /* Document list */ }
297- < div className = "p-2 overflow-auto flex-grow" style = { { height : contentHeight } } >
291+ < div
292+ className = "p-2 overflow-auto flex-grow"
293+ onDragOver = { ( e ) => { if ( ! isCreatingMode && knowledgeBaseName ) { return ; } e . preventDefault ( ) ; e . stopPropagation ( ) ; } }
294+ onDrop = { ( e ) => { e . preventDefault ( ) ; e . stopPropagation ( ) ; } }
295+ onDragEnter = { ( e ) => { e . preventDefault ( ) ; e . stopPropagation ( ) ; } }
296+ onDragLeave = { ( e ) => { e . preventDefault ( ) ; e . stopPropagation ( ) ; } }
297+ >
298298 { showDetail ? (
299- < div style = { { padding : '16px 32px' , height : '100%' , display : ' flex' , flexDirection : 'column' } } >
300- < div style = { { display : ' flex' , justifyContent : 'space -between' , alignItems : 'center' , marginBottom : 20 } } >
301- < span style = { { fontWeight : 700 , fontSize : 18 } } > { t ( 'document.summary.title' ) } </ span >
299+ < div className = "px-8 py-4 h-full flex flex-col" >
300+ < div className = " flex items-center justify -between mb-5" >
301+ < span className = "font-bold text-lg" > { t ( 'document.summary.title' ) } </ span >
302302 < Button
303303 type = "default"
304304 onClick = { handleAutoSummary }
@@ -311,17 +311,9 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
311311 < Input . TextArea
312312 value = { summary }
313313 onChange = { ( e ) => setSummary ( e . target . value ) }
314- style = { {
315- flex : 1 ,
316- minHeight : 0 ,
317- marginBottom : 20 ,
318- resize : 'none' ,
319- fontSize : 18 ,
320- lineHeight : 1.7 ,
321- padding : 20
322- } }
314+ className = "flex-1 min-h-0 mb-5 resize-none text-lg leading-[1.7] p-5"
323315 />
324- < div style = { { display : ' flex' , gap : 12 , justifyContent : 'flex -end' } } >
316+ < div className = " flex gap-3 justify -end" >
325317 < Button
326318 type = "primary"
327319 size = "large"
@@ -345,8 +337,8 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
345337 ) : isCreatingMode ? (
346338 < div className = "flex items-center justify-center border border-gray-200 rounded-md h-full" >
347339 < div className = "text-center p-6" >
348- < div className = "mb-4" >
349- < InfoCircleFilled style = { { fontSize : 36 , color : '#1677ff' } } />
340+ < div className = "mb-4 text-blue-600 text-[36px] " >
341+ < InfoCircleFilled />
350342 </ div >
351343 < h3 className = "text-lg font-medium text-gray-800 mb-2" > { t ( 'document.title.createNew' ) } </ h3 >
352344 < p className = "text-gray-500 text-sm max-w-md" >
@@ -359,19 +351,19 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
359351 < table className = "min-w-full bg-white" >
360352 < thead className = { `${ LAYOUT . TABLE_HEADER_BG } sticky top-0 z-10` } >
361353 < tr >
362- < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } ` } style = { { width : COLUMN_WIDTHS . NAME } } >
354+ < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } w-[ ${ COLUMN_WIDTHS . NAME } ]` } >
363355 { t ( 'document.table.header.name' ) }
364356 </ th >
365- < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } ` } style = { { width : COLUMN_WIDTHS . STATUS } } >
357+ < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } w-[ ${ COLUMN_WIDTHS . STATUS } ]` } >
366358 { t ( 'document.table.header.status' ) }
367359 </ th >
368- < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } ` } style = { { width : COLUMN_WIDTHS . SIZE } } >
360+ < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } w-[ ${ COLUMN_WIDTHS . SIZE } ]` } >
369361 { t ( 'document.table.header.size' ) }
370362 </ th >
371- < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } ` } style = { { width : COLUMN_WIDTHS . DATE } } >
363+ < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } w-[ ${ COLUMN_WIDTHS . DATE } ]` } >
372364 { t ( 'document.table.header.date' ) }
373365 </ th >
374- < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } ` } style = { { width : COLUMN_WIDTHS . ACTION } } >
366+ < th className = { `${ LAYOUT . CELL_PADDING } text-left ${ LAYOUT . HEADER_TEXT } w-[ ${ COLUMN_WIDTHS . ACTION } ]` } >
375367 { t ( 'document.table.header.action' ) }
376368 </ th >
377369 </ tr >
@@ -385,13 +377,7 @@ const DocumentListContainer = forwardRef<DocumentListRef, DocumentListProps>(({
385377 { getFileIcon ( doc . type ) }
386378 </ span >
387379 < span
388- className = { `${ LAYOUT . TEXT_SIZE } font-medium text-gray-800 truncate` }
389- style = { {
390- maxWidth : DOCUMENT_NAME_CONFIG . MAX_WIDTH ,
391- textOverflow : DOCUMENT_NAME_CONFIG . TEXT_OVERFLOW ,
392- whiteSpace : DOCUMENT_NAME_CONFIG . WHITE_SPACE ,
393- overflow : DOCUMENT_NAME_CONFIG . OVERFLOW
394- } }
380+ className = { `${ LAYOUT . TEXT_SIZE } font-medium text-gray-800 truncate max-w-[${ DOCUMENT_NAME_CONFIG . MAX_WIDTH } ] whitespace-${ DOCUMENT_NAME_CONFIG . WHITE_SPACE } overflow-${ DOCUMENT_NAME_CONFIG . OVERFLOW } text-${ DOCUMENT_NAME_CONFIG . TEXT_OVERFLOW } ` }
395381 title = { doc . name }
396382 >
397383 { doc . name }
0 commit comments