perf: support prompt editor dynamic height increase & modify aichat placeholder (#2817)

This commit is contained in:
heheer
2024-09-27 13:45:44 +08:00
committed by GitHub
parent 691476c821
commit 7c8f2ab6f5
25 changed files with 57 additions and 79 deletions

View File

@@ -10,13 +10,13 @@ import { useCallback } from 'react';
const PromptEditor = ({
showOpenModal = true,
showResize = true,
variables = [],
variableLabels = [],
value,
onChange,
onBlur,
h,
minH,
maxH,
maxLength,
placeholder,
title,
@@ -24,13 +24,13 @@ const PromptEditor = ({
bg = 'white'
}: {
showOpenModal?: boolean;
showResize?: boolean;
variables?: EditorVariablePickerType[];
variableLabels?: EditorVariableLabelPickerType[];
value?: string;
onChange?: (text: string) => void;
onBlur?: (text: string) => void;
h?: number;
minH?: number;
maxH?: number;
maxLength?: number;
placeholder?: string;
title?: string;
@@ -58,12 +58,12 @@ const PromptEditor = ({
return (
<>
<Editor
showResize={showResize}
showOpenModal={showOpenModal}
onOpenModal={onOpen}
variables={variables}
variableLabels={variableLabels}
h={h}
minH={minH}
maxH={maxH}
maxLength={maxLength}
value={value}
onChange={onChangeInput}
@@ -75,9 +75,9 @@ const PromptEditor = ({
<MyModal isOpen={isOpen} onClose={onClose} iconSrc="modal/edit" title={title} w={'full'}>
<ModalBody>
<Editor
h={400}
minH={400}
maxH={400}
maxLength={maxLength}
showResize
showOpenModal={false}
variables={variables}
variableLabels={variableLabels}