added viewer for pdf type document
This commit is contained in:
parent
bc2900b573
commit
325a6a5442
@ -1,5 +1,9 @@
|
||||
import React, { useState, useMemo } from "react";
|
||||
import { useActionOnExpense, useExpense, useHasAnyPermission } from "../../hooks/useExpense";
|
||||
import {
|
||||
useActionOnExpense,
|
||||
useExpense,
|
||||
useHasAnyPermission,
|
||||
} from "../../hooks/useExpense";
|
||||
import { formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
@ -11,12 +15,14 @@ import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||
import { REVIEW_EXPENSE } from "../../utils/constants";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const ViewExpense = ({ ExpenseId }) => {
|
||||
const { data, isLoading, isError, error } = useExpense(ExpenseId);
|
||||
const IsReview = useHasUserPermission(REVIEW_EXPENSE);
|
||||
const [imageLoaded, setImageLoaded] = useState({});
|
||||
const { setDocumentView } = useExpenseContext();
|
||||
const navigate = useNavigate();
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
@ -35,7 +41,6 @@ const userPermissions = useSelector(
|
||||
(state) => state?.globalVariables?.loginUser?.featurePermissions || []
|
||||
);
|
||||
|
||||
|
||||
const nextStatusWithPermission = useMemo(() => {
|
||||
if (!Array.isArray(data?.nextStatus)) return [];
|
||||
|
||||
@ -50,8 +55,6 @@ const nextStatusWithPermission = useMemo(() => {
|
||||
});
|
||||
}, [data, userPermissions]);
|
||||
|
||||
|
||||
|
||||
const { mutate: MakeAction } = useActionOnExpense(() => reset());
|
||||
|
||||
const onSubmit = (formData) => {
|
||||
@ -287,7 +290,6 @@ const nextStatusWithPermission = useMemo(() => {
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user