import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; import TopThree from "./topthree"; import { connect } from "react-redux"; import { setCurrentView, setCurrentReference, } from "../../store/currentView/action"; import { JSONPath as jsonpath } from "jsonpath-plus"; import transLookup from "../../data/lookuptranslations.json"; import { deleteAwaitingSubmissionsFromBlob, getAwaitingSubmissionFromBlobProxy, } from "../../actions"; import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action"; import { parseCookies, setCookie, destroyCookie } from "nookies"; import { getFormCollectionByID } from "../../components/utils"; const AwaitingSubmissionFromBlob = (props) => { let { t } = useTranslation(); const router = useRouter(); const { locale } = router; const { setCurrentView } = props; let topthreeRowArr = []; let showTopThreeArr = props.awaitingSubmissionFromBlob.value; let showTopThreeArrDets = props.awaitingSubmissionFromBlob.case; Object.keys(showTopThreeArrDets).map((key, index) => { let createdDate = showTopThreeArrDets[key].createdon; showTopThreeArr[key].createdDate = createdDate; }); showTopThreeArr.sort(function compare(a, b) { var dateA = new Date(a.createdDate); var dateB = new Date(b.createdDate); return dateB - dateA; }); const raisedDate = (datePart) => { var dateObj = new Date(datePart); return dateObj.toLocaleString(); }; const deleteCaseItem = (containerID, caseID) => { let cookies = parseCookies(); console.log("sssss", containerID, caseID); deleteAwaitingSubmissionsFromBlob(containerID, caseID) .then((data) => { return data; }) .then(() => { getAwaitingSubmissionFromBlobProxy(containerID).then((data) => { props.setAwaitingSubmissionFromBlob(data); }); }); }; let topThreeOnlyArr = showTopThreeArr.slice(0, 3); //console.log(showTopThreeArr); Object.keys(topThreeOnlyArr).map((key, index) => { //console.log(key, showTopThreeArr[key].pinswg_appealcasetype); //console.log("subsssss:", showTopThreeArr[key]); let urlname = getFormCollectionByID( showTopThreeArr[key].pinswg_appealcasetype ).UrlName; topthreeRowArr.push( <>