Revert "fix(web): prompt editor"

This reverts commit 71e5b6586a.
This commit is contained in:
zhaoying
2026-04-15 14:50:19 +08:00
parent 71e5b6586a
commit 5ac2d5602e
4 changed files with 82 additions and 165 deletions

View File

@@ -1,39 +0,0 @@
import { forwardRef, useImperativeHandle, useState } from 'react'
import ChatContent from './ChatContent'
import type { ChatItem } from './types'
import type { ReactNode } from 'react'
export interface PromptChatPanelRef {
append: (item: ChatItem) => void
clear: () => void
}
interface PromptChatPanelProps {
classNames?: string
contentClassNames?: string
empty: ReactNode
labelFormat: (item: ChatItem) => any
}
const PromptChatPanel = forwardRef<PromptChatPanelRef, PromptChatPanelProps>((props, ref) => {
const [chatList, setChatList] = useState<ChatItem[]>([])
useImperativeHandle(ref, () => ({
append: (item) => setChatList(prev => [...prev, item]),
clear: () => setChatList([]),
}))
return (
<ChatContent
classNames={props.classNames}
contentClassNames={props.contentClassNames}
empty={props.empty}
data={chatList}
streamLoading={false}
labelPosition="top"
labelFormat={props.labelFormat}
/>
)
})
export default PromptChatPanel