import { UxTask } from "App/services/UxtestingService"; import React from 'react' import { Button, Input, Switch, Typography } from 'antd' function StepsModal({ onAdd, onHide, editTask }: { onAdd: (step: UxTask) => void; onHide: () => void, editTask?: UxTask }) { const [title, setTitle] = React.useState(editTask?.title ?? ''); const [description, setDescription] = React.useState(editTask?.description ?? ''); const [isAnswerEnabled, setIsAnswerEnabled] = React.useState(editTask?.allowTyping ?? false); const save = () => { onAdd({ title: title, description: description || '', allowTyping: isAnswerEnabled, }); onHide(); }; return (
Add a task or question
Title/Question setTitle(e.target.value)} placeholder={'Task title'} className={'mb-4'} /> Instructions setDescription(e.target.value)} placeholder={'Task instructions'} className={'mb-4'} /> Allow participants to type an answer setIsAnswerEnabled(checked)} checkedChildren="Yes" unCheckedChildren="No" />
Enabling this option will show a text field for participants to type their answer.
); } export default StepsModal;