Instrumento v2: 44 preguntas + widget text_short
This commit is contained in:
@@ -4,6 +4,7 @@ import { RadioGroup } from './widgets/radio-group'
|
||||
import { CheckboxGroup } from './widgets/checkbox-group'
|
||||
import { RatingScale } from './widgets/rating-scale'
|
||||
import { TextAreaField } from './widgets/text-area-field'
|
||||
import { TextShortField } from './widgets/text-short-field'
|
||||
|
||||
interface QuestionRendererProps {
|
||||
question: Question
|
||||
@@ -72,7 +73,20 @@ export function QuestionRenderer({
|
||||
)
|
||||
}
|
||||
|
||||
if (type === 'text_long' || type === 'text_short') {
|
||||
if (type === 'text_short') {
|
||||
return (
|
||||
<TextShortField
|
||||
name={code}
|
||||
label={prompt}
|
||||
value={(answers[code] as string) ?? ''}
|
||||
required={required}
|
||||
onChange={(v) => onChange(code, v)}
|
||||
error={error}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
if (type === 'text_long') {
|
||||
return (
|
||||
<TextAreaField
|
||||
name={code}
|
||||
|
||||
Reference in New Issue
Block a user