feat: 暂存添加ai chat and prompt generate

This commit is contained in:
2024-09-26 01:18:04 +08:00
parent 3da62fd254
commit 553e4d62f0
16 changed files with 1265 additions and 60 deletions

View File

@@ -11,6 +11,8 @@ type Props = {
style?: React.CSSProperties;
language?: string;
listen?: boolean;
placeholder?: string;
onBlur?: () => void;
};
export const TextArea = (props: Props) => {
const [code, setCode] = useState<string>('');
@@ -27,12 +29,13 @@ export const TextArea = (props: Props) => {
<div className={clsx('min-h-16 max-h-52 overflow-scroll scrollbar p-1 ', props.className)}>
<CodeEditor
value={code}
language='js'
language={props.language || 'js'}
className='border rounded-sm '
readOnly={props.readonly}
placeholder='Please enter JS code.'
placeholder={props.placeholder || 'Please enter JS code.'}
onChange={(evn) => _onChange(evn.target.value)}
padding={10}
onBlur={props.onBlur}
style={{
// backgroundColor: '#f5f5f5',
fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace',

View File

@@ -59,12 +59,7 @@ const FormModal = () => {
<Input />
</Form.Item>
<Form.Item name='code' label='code'>
<TextArea
value={containerStore.formData.code}
style={{
height: '200px',
}}
/>
<TextArea />
</Form.Item>
<Form.Item label=' ' colon={false}>
<Button type='primary' htmlType='submit'>