import { Button, Input, Switch, Typography } from 'antd'; import React from 'react'; import { UxTask } from 'App/services/UxtestingService'; import { useTranslation } from 'react-i18next'; function StepsModal({ onAdd, onHide, editTask, typingEnabled, }: { onAdd: (step: UxTask) => void; onHide: () => void; editTask?: UxTask; typingEnabled?: boolean; }) { const { t } = useTranslation(); const [title, setTitle] = React.useState(editTask?.title ?? ''); const [description, setDescription] = React.useState( editTask?.description ?? '', ); const [isAnswerEnabled, setIsAnswerEnabled] = React.useState( editTask?.allowTyping ?? typingEnabled, ); const save = () => { onAdd({ title, description: description || '', allowTyping: Boolean(isAnswerEnabled), }); onHide(); }; return (