feat(template): 📝 Add Quizz
This commit is contained in:
@ -66,7 +66,11 @@ export const InputChatStep = ({
|
||||
{hasAvatar && (
|
||||
<div className="flex w-6 xs:w-10 h-6 xs:h-10 mr-2 mb-2 mt-1 flex-shrink-0 items-center" />
|
||||
)}
|
||||
<Input step={step} onSubmit={handleSubmit} defaultValue={defaultValue} />
|
||||
<Input
|
||||
step={step}
|
||||
onSubmit={handleSubmit}
|
||||
defaultValue={defaultValue?.toString()}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ export const parseVariables =
|
||||
})
|
||||
if (!variable) return ''
|
||||
return (
|
||||
(options.fieldToParse === 'value' ? variable.value : variable.id) || ''
|
||||
(options.fieldToParse === 'value'
|
||||
? variable.value?.toString()
|
||||
: variable.id) || ''
|
||||
)
|
||||
})
|
||||
}
|
||||
@ -32,7 +34,7 @@ export const evaluateExpression = (variables: Variable[]) => (str: string) => {
|
||||
)
|
||||
)
|
||||
const evaluatedResult = func(...variables.map((v) => v.value))
|
||||
return isNotDefined(evaluatedResult) ? '' : evaluatedResult.toString()
|
||||
return isNotDefined(evaluatedResult) ? '' : evaluatedResult
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
return str
|
||||
|
Reference in New Issue
Block a user