221
};
222
case 'array': {
224
>
? field.items.enum.map(value => ({ id: value, label: value }))
225
: field.items.anyOf.map(option => ({ id: option.const, label: option.title }));
227
>
...base,
228
>
kind: ChatInputQuestionKind.MultiSelect,
229
>
options,
230
>
min: field.minItems,
231
>
max: field.maxItems,
232
>
};
233
>
}
234
case 'string': {
235
if (hasKey(field, { enum: true })) {
237
>
const options: ChatInputOption[] = field.enum.map((value, idx) => ({ id: value, label: enumNames?.[idx] ?? value }));
238
>
return { ...base, kind: ChatInputQuestionKind.SingleSelect, options };
239
>
}
240
if (hasKey(field, { oneOf: true })) {
241
const options: ChatInputOption[] = field.oneOf.map(option => ({ id: option.const, label: option.title }));