From a01fc9ef49fa1d702edfc4f5e3fb71a6944f88e4 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 12 Sep 2023 10:42:57 +0800 Subject: [PATCH] feat: support var type paragraph --- app/components/welcome/index.tsx | 32 ++++++++++++++++++++------------ types/app.ts | 2 +- utils/prompt.ts | 16 ++++++++++++---- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/app/components/welcome/index.tsx b/app/components/welcome/index.tsx index 90476f0..16a2742 100644 --- a/app/components/welcome/index.tsx +++ b/app/components/welcome/index.tsx @@ -92,10 +92,10 @@ const Welcome: FC = ({ return (
{promptConfig.prompt_variables.map(item => ( -
- +
+ {item.type === 'select' - ? ( + && ( { setInputs({ ...inputs, [item.key]: e.target.value }) }} - className={'w-full flex-grow py-2 pl-3 pr-3 box-border rounded-lg bg-gray-50'} - maxLength={item.max_length || DEFAULT_VALUE_MAX_LEN} - /> )} + {item.type === 'string' && ( + { setInputs({ ...inputs, [item.key]: e.target.value }) }} + className={'w-full flex-grow py-2 pl-3 pr-3 box-border rounded-lg bg-gray-50'} + maxLength={item.max_length || DEFAULT_VALUE_MAX_LEN} + /> + )} + {item.type === 'paragraph' && ( +