Feat: Refactor BeginForm with shadcn #3221 (#7792)

### What problem does this PR solve?

Feat: Refactor BeginForm with shadcn #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-05-22 15:33:40 +08:00
committed by GitHub
parent ae70512f5d
commit b6f3a6a68a
7 changed files with 339 additions and 124 deletions

View File

@ -43,20 +43,26 @@ export function useFormConfigMap() {
const FormConfigMap = {
[Operator.Begin]: {
component: BeginForm,
defaultValues: {},
defaultValues: {
prologue: t('chat.setAnOpenerInitial'),
},
schema: z.object({
name: z
.string()
.min(1, {
message: t('common.namePlaceholder'),
})
.trim(),
age: z
prologue: z
.string()
.min(1, {
message: t('common.namePlaceholder'),
})
.trim(),
query: z.array(
z.object({
key: z.string(),
type: z.string(),
value: z.string(),
optional: z.boolean(),
name: z.string(),
options: z.array(z.union([z.number(), z.string(), z.boolean()])),
}),
),
}),
},
[Operator.Retrieval]: {