import React, { useCallback, useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { toast } from "react-toastify"; import { Namespaces } from "../../../../i18n/i18n"; import assignmentCompleteService, { GetAssignmentForCompletion, } from "./services/assignmentCompleteService"; import { DateView } from "../../../../components/common/DateView"; import LoadingPanel from "../../../../components/common/LoadingPanel"; import AssigneePanel from "../../tasks/components/AssigneePanel"; import TaskTypeAndNameDisplayPanel from "../../workflowTemplates/components/TaskTypeAndNameDisplayPanel"; import Button, { ButtonType } from "../../../../components/common/Button"; import TaskProcessor from "./components/TaskProcessor"; import "../../../../Sass/_assignmentComplete.scss"; const AssignmentComplete: React.FC = () => { const { assignmentId } = useParams<{ assignmentId: string }>(); const { t } = useTranslation(Namespaces.Common); const [isTaskValid, setIsTaskValid] = useState(false); const [taskData, setTaskData] = useState>({}); const [assignmentDetails, setAssignmentDetails] = useState(); const loadAssignment = useCallback(async () => { if (assignmentId === undefined) { return; } try { const assignmentDetails = await assignmentCompleteService.getAssignmentForCompletion( BigInt(assignmentId), ); if (assignmentDetails) { setAssignmentDetails(assignmentDetails); setTaskData({ comments: assignmentDetails.assignment.comments ?? "", }); } } catch (ex: any) { toast.error(ex.message); } }, [assignmentId]); useEffect(() => { void loadAssignment(); }, [loadAssignment]); if (assignmentDetails === undefined) { return ; } var taskDefinition = assignmentDetails.workflowTemplateVersion.tasks.find( (t) => t.config.guid == assignmentDetails.task.taskGuid, )!; return (

{assignmentDetails.activity.name}

Current Task Info
Name
{assignmentDetails.task.taskName}
Started
Assigned to
Contacts
Roles
); }; export default AssignmentComplete;