update tasks to use types

This commit is contained in:
AbdBarho
2023-02-03 08:30:01 +01:00
parent db5ea75796
commit ae829d0e3d
4 changed files with 8 additions and 5 deletions
@@ -6,6 +6,7 @@ import { MessageTable } from "src/components/Messages/MessageTable";
import { TwoColumnsWithCards } from "src/components/Survey/TwoColumnsWithCards";
import { TaskSurveyProps } from "src/components/Tasks/Task";
import { TaskHeader } from "src/components/Tasks/TaskHeader";
import { LabelTaskReply } from "src/types/TaskResponses";
import { LabelTaskType } from "src/types/Tasks";
const isRequired = (labelName: string, requiredLabels?: string[]) => {
@@ -18,7 +19,7 @@ export const LabelTask = ({
isEditable,
onReplyChanged,
onValidityChanged,
}: TaskSurveyProps<LabelTaskType, { text: string; labels: Record<string, number>; message_id: string }>) => {
}: TaskSurveyProps<LabelTaskType, LabelTaskReply>) => {
const { t } = useTranslation("labelling");
const [values, setValues] = useState<number[]>(new Array(task.labels.length).fill(null));
const [userInputMade, setUserInputMade] = useBoolean(false);