1
This commit is contained in:
@@ -15,9 +15,9 @@ export default function CreateAssistant() {
|
||||
// State for form fields
|
||||
const [formData, setFormData] = useState({
|
||||
name: '',
|
||||
roleAndTasks: `${t('build.example')}:
|
||||
${t('build.exampleOne')}
|
||||
${t('build.exampleTwo')}
|
||||
roleAndTasks: `示例:
|
||||
示例一
|
||||
示例二
|
||||
1. XX
|
||||
2. XX
|
||||
3. …`
|
||||
@@ -86,37 +86,45 @@ ${t('build.exampleTwo')}
|
||||
}
|
||||
};
|
||||
|
||||
return <DialogContent className="sm:max-w-[625px]">
|
||||
return <DialogContent className="sm:max-w-[625px] bg-[#000000]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t('build.establishAssistant')}</DialogTitle>
|
||||
<DialogTitle className="text-[#fff]">创建NPC</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="flex flex-col gap-8 py-6">
|
||||
<div className="">
|
||||
<label htmlFor="name" className="bisheng-label">{t('build.assistantName')}<span className="bisheng-tip">*</span></label>
|
||||
<Input id="name" name="name" placeholder={t('build.giveAssistantName')} className="mt-2" value={formData.name} onChange={handleChange} />
|
||||
{errors.name && <p className="bisheng-tip mt-1">{errors.name}</p>}
|
||||
<label htmlFor="name" className="bisheng-label text-[#999999]"><span className="bisheng-tip text-[#FF6060]">* </span>NPC名称</label>
|
||||
<Input id="name" name="name" placeholder="给NPC取一个名字" className="mt-2 npcInput" value={formData.name} onChange={handleChange} />
|
||||
{errors.name && <p className="bisheng-tip mt-1 text-[#999999]">名称不可为空</p>}
|
||||
</div>
|
||||
<div className="">
|
||||
<label htmlFor="roleAndTasks" className="bisheng-label">{t('build.whatWant')}</label>
|
||||
<label htmlFor="roleAndTasks" className="bisheng-label text-[#999999]">你希望NPC的角色是什么,具体完成什么任务?</label>
|
||||
<Textarea
|
||||
id="roleAndTasks"
|
||||
name="roleAndTasks"
|
||||
placeholder={t('build.forExample')}
|
||||
placeholder=""
|
||||
maxLength={1000}
|
||||
className="mt-2 min-h-32"
|
||||
className="mt-2 min-h-32 npcInput overflow-auto scrollbar-hide"
|
||||
value={formData.roleAndTasks}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
{errors.roleAndTasks && <p className="bisheng-tip mt-1">{errors.roleAndTasks}</p>}
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
{/* <DialogFooter>
|
||||
<DialogClose>
|
||||
<Button variant="outline" className="px-11" type="button" onClick={() => setFormData({ name: '', roleAndTasks: '' })}>{t('cancle')}</Button>
|
||||
<Button variant="outline" className="px-11 baogao-btn baogao-btn2" type="button" onClick={() => setFormData({ name: '', roleAndTasks: '' })}>取 消</Button>
|
||||
</DialogClose>
|
||||
<Button disabled={loading} type="submit" className="px-11" onClick={handleSubmit}>
|
||||
<Button disabled={loading} type="submit" className="px-11 baogao-btn baogao-btn2" onClick={handleSubmit}>
|
||||
{loading && <LoadIcon className="mr-2" />}
|
||||
{t('build.create')}</Button>
|
||||
</DialogFooter>
|
||||
创 建</Button>
|
||||
</DialogFooter> */}
|
||||
<div className="flex justify-center ">
|
||||
<DialogClose>
|
||||
<Button variant="outline" className="px-11 baogao-btn baogao-btn2" type="button" onClick={() => setFormData({ name: '', roleAndTasks: '' })}>取 消</Button>
|
||||
</DialogClose>
|
||||
<Button disabled={loading} type="submit" className="px-11 baogao-btn baogao-btn2" onClick={handleSubmit}>
|
||||
{loading && <LoadIcon className="mr-2" />}
|
||||
创 建</Button>
|
||||
</div>
|
||||
</DialogContent>
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user