diff --git a/teachertool/src/components/CriteriaResultEntry.tsx b/teachertool/src/components/CriteriaResultEntry.tsx index 8aef5ccb998a..17f0ac761444 100644 --- a/teachertool/src/components/CriteriaResultEntry.tsx +++ b/teachertool/src/components/CriteriaResultEntry.tsx @@ -18,6 +18,9 @@ import { Button } from "react-common/components/controls/Button"; import { setEvalResult } from "../transforms/setEvalResult"; import { showToast } from "../transforms/showToast"; import { makeToast } from "../utils"; +import { reAddCriteriaToChecklist } from "../transforms/reAddCriteriaToChecklist"; +import { dismissToast } from "../state/actions"; +import { softDeleteCriteriaFromChecklist } from "../transforms/softDeleteCriteriaFromChecklist"; interface CriteriaResultNotesProps { criteriaId: string; @@ -76,6 +79,25 @@ const CriteriaResultError: React.FC = ({ criteriaInsta ); }; +const UndoDeleteCriteriaButton: React.FC<{ criteriaId: string, toastId: string }> = ({ criteriaId, toastId }) => { + const { dispatch } = useContext(AppStateContext); + const handleUndoClicked = () => { + reAddCriteriaToChecklist(criteriaId); + if (toastId) { + dispatch(dismissToast(toastId)); + } + } + + return ( +