Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 2x 6x 6x 6x 3x 3x 2x 3x 2x 3x 2x | import { Navigate, useParams } from "react-router";
import { useGetItem } from "@/api";
import { LoadingSpinner } from "@/components";
import { AmendmentForm as CapitatedForm } from "@/features/forms/waiver/capitated";
import { AmendmentForm as ContractingForm } from "@/features/forms/waiver/contracting";
export const Amendment = () => {
const { id } = useParams();
const { data: submission, isLoading: isSubmissionLoading } = useGetItem(id);
if (submission == undefined && isSubmissionLoading === true) {
return <LoadingSpinner />;
}
Iif (submission == undefined && isSubmissionLoading === false) {
return <Navigate to="/dashboard" />;
}
const isCapitated = submission._source.changelog.find(
(event) =>
event._source.event === "capitated-initial" || event._source.event === "capitated-renewal",
);
const isContracting = submission._source.changelog.find(
(event) =>
event._source.event === "contracting-initial" ||
event._source.event === "contracting-renewal",
);
if (isCapitated) {
return <CapitatedForm waiverId={id} />;
}
if (isContracting) {
return <ContractingForm waiverId={id} />;
}
return <Navigate to="/dashboard" />;
};
|