feat(web): share chat & app chat support files

This commit is contained in:
zhaoying
2026-02-06 21:11:51 +08:00
parent 2db583d62d
commit 6849c620b8
34 changed files with 1571 additions and 251 deletions

View File

@@ -1,8 +1,8 @@
/*
* @Author: ZhaoYing
* @Date: 2025-12-10 16:46:09
* @Last Modified by: ZhaoYing
* @Last Modified time: 2025-12-11 13:43:51
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-06 21:05:09
*/
import { type FC } from 'react'
import ChatInput from './ChatInput'
@@ -10,35 +10,43 @@ import type { ChatProps } from './types'
import ChatContent from './ChatContent'
/**
* 聊天组件 - 主要组件,由内容区域和输入框组成
* 提供完整的聊天界面功能,包括消息显示和输入交互
* Chat Component - Main component consisting of content area and input box
* Provides complete chat interface functionality, including message display and input interaction
*/
const Chat: FC<ChatProps> = ({
empty,
data,
onChange,
onSend,
streamLoading = false,
loading,
onChange,
onSend,
streamLoading = false,
loading,
contentClassName = '',
children,
labelFormat,
errorDesc
errorDesc,
fileList,
fileChange
}) => {
return (
<div className="rb:h-full rb:relative rb:pt-2">
{/* 聊天内容显示区域 */}
{/* Chat content display area */}
<ChatContent
classNames={contentClassName}
data={data}
classNames={contentClassName}
data={data}
streamLoading={streamLoading}
empty={empty}
labelFormat={labelFormat}
errorDesc={errorDesc}
/>
{/* 聊天输入框区域 */}
<ChatInput onChange={onChange} onSend={onSend} loading={loading}>
{/* Chat input area */}
<ChatInput
fileList={fileList}
onChange={onChange}
onSend={onSend}
loading={loading}
fileChange={fileChange}
>
{children}
</ChatInput>
</div>