feat(web): chat add file info
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2025-12-10 16:46:17
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-04-10 18:46:57
|
||||
* @Last Modified time: 2026-04-14 10:13:56
|
||||
*/
|
||||
import { type FC, useRef, useEffect, useState } from 'react'
|
||||
import clsx from 'clsx'
|
||||
@@ -174,6 +174,7 @@ const ChatContent: FC<ChatContentProps> = ({
|
||||
)
|
||||
}
|
||||
|
||||
const documentType = (file.file_type || file.type)?.split('/')
|
||||
return (
|
||||
<Flex
|
||||
key={file.url || file.uid}
|
||||
@@ -208,7 +209,7 @@ const ChatContent: FC<ChatContentProps> = ({
|
||||
></div>
|
||||
<div className="rb:flex-1 rb:w-32.5">
|
||||
<div className="rb:leading-4 rb:text-ellipsis rb:overflow-hidden rb:whitespace-nowrap">{file.name}</div>
|
||||
<div className="rb:leading-3.5 rb:mt-0.5 rb:text-[#5B6167] rb:text-ellipsis rb:overflow-hidden rb:whitespace-nowrap">{file.type?.split('/')[file.type?.split('/').length - 1]} · {file.size}</div>
|
||||
<div className="rb:leading-3.5 rb:mt-0.5 rb:text-[#5B6167] rb:text-ellipsis rb:overflow-hidden rb:whitespace-nowrap">{documentType?.[documentType.length - 1]} · {file.size}</div>
|
||||
</div>
|
||||
</Flex>
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 16:58:03
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-04-07 21:21:52
|
||||
* @Last Modified time: 2026-04-13 18:32:58
|
||||
*/
|
||||
/**
|
||||
* Conversation Page
|
||||
@@ -397,7 +397,10 @@ const Conversation: FC = () => {
|
||||
return {
|
||||
type: file.type,
|
||||
transfer_method: 'local_file',
|
||||
upload_file_id: file.response.data.file_id
|
||||
upload_file_id: file.response.data.file_id,
|
||||
file_type: file.response.data.file_type,
|
||||
size: file.response.data.file_size,
|
||||
name: file.response.data.file_name
|
||||
}
|
||||
}
|
||||
}),
|
||||
@@ -444,7 +447,7 @@ const Conversation: FC = () => {
|
||||
})
|
||||
}
|
||||
|
||||
console.log('chatList', chatList, streamLoadingRef.current)
|
||||
console.log('chatList', fileList, streamLoadingRef.current)
|
||||
|
||||
return (
|
||||
<Flex className="rb:w-full rb:p-[-16px]!">
|
||||
|
||||
Reference in New Issue
Block a user