Replies: 3 comments 2 replies
-
nice question, we are considering the scope of opening, should we default open it in chatInputArea ? i thinks maybe its not a good idea ,if we default open it in chatInputArea, something may not so flexible
now we reserved an api named renderInput (u can find it in source code, but not actually finished it) now this api is work such as this <div ref={areaHtml}>{renderInput ?? <ChatInputArea />}</div> but actually will have some args, we still design about it, such as this renderInput: {
defaultDom: ReactNode,
onSend,
onDeleteAll
// TODO
} |
Beta Was this translation helpful? Give feedback.
-
now u can use Hooks and renderInput to achieve it
than in action render, u can put a antd picture upload components,than set a state in it const [files,setUploadFiles] = useState()
<div style={{ background: theme.colorBgLayout }}>
<ProChat
actions={{
render: (defaultDoms) => {
return <Upload onChange={setUploadFiles} /> // this is antd upload
}
}}
renderInput={()=>{
return <CustomComponents/>
}}
/>
</div> in CustomComponents U can use ProChat.sendMessage(message + files) to send, and u can choose the way to deal with files than send it we will provider a simpler way and docs deme to help u in next few weeks |
Beta Was this translation helpful? Give feedback.
-
Thanks for your attention.
I want to ask how to add images or other files to the chat input area.
Anyone can provide me with some guidance to deal with it?
Thanks again
Beta Was this translation helpful? Give feedback.
All reactions