import React, { useState } from 'react' import { handlePagingFunc } from '../../../Pagination/HandlePagination'; import PaginatedList from '../../../Pagination/PaginatedList'; export default function RelativeTable({relativeList}) { // Handle Pagination const [currentPage, setCurrentPage] = useState(0); const indexOfFirstItem = Number(currentPage); const indexOfLastItem =Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE); const currentRelativeList = relativeList?.slice(indexOfFirstItem, indexOfLastItem); const handlePagination = (e) => { handlePagingFunc(e, setCurrentPage); }; return (
<> {relativeList && relativeList?.length > 0 ? ( currentRelativeList.map((value, index) => ( )) ) : ( )}

{value.firstname && value.firstname} {value.lastname && value.lastname}

{value.email && value.email}
{/* Family Type */} {value.family_type && value.family_type.toUpperCase()} {value.status && value.status}
No Members Found
{/* PAGINATION BUTTON */} = relativeList?.length ? true : false } data={relativeList} start={indexOfFirstItem} stop={indexOfLastItem} /> {/* END OF PAGINATION BUTTON */}
); };