feat: add save and send functionality for user message
Adds a "Save" button to the edit message form in Playground, allowing users to save changes without immediately submitting them. This also introduces a new `isSend` flag to the `onEditFormSubmit` prop, enabling developers to control whether a message should be sent immediately or saved for later submission. This enhances flexibility and user control during the message editing process.
This commit is contained in:
@@ -46,8 +46,8 @@ export const PlaygroundChat = () => {
|
||||
isProcessing={streaming}
|
||||
isSearchingInternet={isSearchingInternet}
|
||||
sources={message.sources}
|
||||
onEditFormSubmit={(value) => {
|
||||
editMessage(index, value, !message.isBot)
|
||||
onEditFormSubmit={(value, isSend) => {
|
||||
editMessage(index, value, !message.isBot, isSend)
|
||||
}}
|
||||
onSourceClick={(data) => {
|
||||
setSource(data)
|
||||
|
||||
@@ -86,11 +86,10 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
|
||||
placeholder={t("generalSettings.tts.ttsVoice.placeholder")}
|
||||
className="w-full mt-4 sm:mt-0 sm:w-[200px]"
|
||||
options={data?.browserTTSVoices?.map(
|
||||
(voice) =>
|
||||
({
|
||||
label: `${voice.voiceName} - ${voice.lang}`.trim(),
|
||||
value: voice.voiceName
|
||||
}) || []
|
||||
(voice) => ({
|
||||
label: `${voice.voiceName} - ${voice.lang}`.trim(),
|
||||
value: voice.voiceName
|
||||
})
|
||||
)}
|
||||
{...form.getInputProps("voice")}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user