Skip to content

Commit

Permalink
Reopen confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh-aot committed Dec 20, 2024
1 parent 8bd618c commit e247164
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, { useCallback } from "react";
import LinkCaseFileModal from "@/components/App/CaseFiles/Profile/LinkCaseFileModal";
import MenuActionDropdown from "@/components/Shared/MenuActionDropdown";
import ConfirmationModal from "@/components/Shared/Popups/ConfirmationModal";
import {
useDeleteCaseFile,
useLinkCaseFile,
useUnlinkCaseFile,
useUpdateCaseFileStatus,
} from "@/hooks/useCaseFiles";
import { CaseFile } from "@/models/CaseFile";
import { useQueryClient } from "@tanstack/react-query";
import ConfirmationModal from "@/components/Shared/Popups/ConfirmationModal";
import { useModal } from "@/store/modalStore";
import { notify } from "@/store/snackbarStore";
import { useQueryClient } from "@tanstack/react-query";
import { useRouter } from "@tanstack/react-router";
import LinkCaseFileModal from "@/components/App/CaseFiles/Profile/LinkCaseFileModal";
import React, { useCallback } from "react";

interface CaseFileActionsProps {
status: string;
Expand Down Expand Up @@ -132,9 +132,20 @@ const CaseFileActions: React.FC<CaseFileActionsProps> = ({
text: "Reopen Case File",
onClick: () => {
// Handle reopening case file
updateCaseFileStatus({
id: caseFileData?.id ?? 0,
caseFileStatus: { status: "OPEN" },
setOpen({
content: (
<ConfirmationModal
title="Reopen Case File?"
description="You are about to reopen this case file. Are you sure?"
confirmButtonText="Reopen Case File"
onConfirm={() => {
updateCaseFileStatus({
id: caseFileData?.id ?? 0,
caseFileStatus: { status: "OPEN" },
});
}}
/>
),
});
},
hidden: status?.toLowerCase() === "open",
Expand Down

0 comments on commit e247164

Please sign in to comment.