@@ -54,7 +54,7 @@ const ReportTable = (props) => {
54
54
const [ isLoader , setIsLoader ] = useState ( { } ) ;
55
55
// const [selectedPublicRole, setSelectedPublicRole] = useState("");
56
56
// const [isCelebration, setIsCelebration] = useState(false);
57
- const [ currentLists , setCurrentLists ] = useState ( [ ] ) ;
57
+ // const [currentLists, setCurrentLists] = useState([]);
58
58
// const [isPublic, setIsPublic] = useState({});
59
59
// const [isPublicProfile, setIsPublicProfile] = useState({});
60
60
// const [publicUserName, setIsPublicUserName] = useState("");
@@ -250,19 +250,20 @@ const ReportTable = (props) => {
250
250
// Get current list
251
251
const indexOfLastDoc = currentPage * props . docPerPage ;
252
252
const indexOfFirstDoc = indexOfLastDoc - props . docPerPage ;
253
- useEffect ( ( ) => {
254
- // `currentLists` is total record render on current page
255
- const currentList = props . List ?. slice ( indexOfFirstDoc , indexOfLastDoc ) ;
256
- //check public template and save in a object to show public and private template
257
- // setIsPublic(
258
- // currentList.reduce((acc, item) => {
259
- // acc[item.objectId] = item?.IsPublic || false;
260
- // return acc;
261
- // }, {})
262
- // );
263
- setCurrentLists ( currentList ) ;
264
- // eslint-disable-next-line react-hooks/exhaustive-deps
265
- } , [ indexOfLastDoc , indexOfFirstDoc ] ) ;
253
+ const currentList = props . List ?. slice ( indexOfFirstDoc , indexOfLastDoc ) ;
254
+ // useEffect(() => {
255
+ // // `currentLists` is total record render on current page
256
+ // const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
257
+ // //check public template and save in a object to show public and private template
258
+ // // setIsPublic(
259
+ // // currentList.reduce((acc, item) => {
260
+ // // acc[item.objectId] = item?.IsPublic || false;
261
+ // // return acc;
262
+ // // }, {})
263
+ // // );
264
+ // setCurrentLists(currentList);
265
+ // // eslint-disable-next-line react-hooks/exhaustive-deps
266
+ // }, [indexOfLastDoc, indexOfFirstDoc]);
266
267
267
268
// Change page
268
269
const paginateFront = ( ) => setCurrentPage ( currentPage + 1 ) ;
@@ -928,7 +929,7 @@ const ReportTable = (props) => {
928
929
< tbody className = "text-[12px]" >
929
930
{ props . List ?. length > 0 && (
930
931
< >
931
- { currentLists . map ( ( item , index ) =>
932
+ { currentList . map ( ( item , index ) =>
932
933
props . ReportName === "Contactbook" ? (
933
934
< tr className = "border-y-[1px]" key = { index } >
934
935
{ props . heading . includes ( "Sr.No" ) && (
0 commit comments