error msg modified

parent 4d94027e
...@@ -15,13 +15,13 @@ function LeftSidebar() { ...@@ -15,13 +15,13 @@ function LeftSidebar() {
useEffect(() => { useEffect(() => {
if(inputValue!==null){ if (inputValue !== null) {
const debounceTimeout = setTimeout(() => { const debounceTimeout = setTimeout(() => {
const data = { const data = {
reportees: userDetails.user.reportees, reportees: userDetails.user.reportees,
page: (inputValue==="")?currPage:1, page: (inputValue === "") ? currPage : 1,
perPage: 10, perPage: 10,
searchText:inputValue searchText: inputValue
}; };
dispatch(fetchReportees(data)); dispatch(fetchReportees(data));
}, 1000); }, 1000);
...@@ -66,7 +66,7 @@ function LeftSidebar() { ...@@ -66,7 +66,7 @@ function LeftSidebar() {
{ {
(loading) ? <Loading /> : (loading) ? <Loading /> :
<div className="p-2 bg-[#E9EDEE] mt-4 max-h-[70vh] overflow-auto"> <div className="p-2 bg-[#E9EDEE] mt-4 max-h-[70vh] overflow-auto">
{reportees?.map(({ empName, score, empId }) => ( {(reportees.length) ? reportees?.map(({ empName, score, empId }) => (
<button onClick={() => dispatch(setViewReportee(empId))} <button onClick={() => dispatch(setViewReportee(empId))}
// to={`/viewreportee`} // to={`/viewreportee`}
className={`flex items-center hover:bg-blue-400 hover:text-white bg-${viewReportee?.empId == empId ? "blue-400 text-white" : "white" className={`flex items-center hover:bg-blue-400 hover:text-white bg-${viewReportee?.empId == empId ? "blue-400 text-white" : "white"
...@@ -80,12 +80,15 @@ function LeftSidebar() { ...@@ -80,12 +80,15 @@ function LeftSidebar() {
</p> </p>
</button> </button>
))} )) : <div className="w-full h-full">
<p className="text-center align-middle text-blue-500 font-bold">No Records Found</p>
</div>
}
</div> </div>
} }
<div> <div>
{ {
reportees.length>0 && pagesCount>1 && ( reportees.length > 0 && pagesCount > 1 && (
<PaginationComponent <PaginationComponent
currentPage={currPage} currentPage={currPage}
totalPages={pagesCount} totalPages={pagesCount}
......
...@@ -75,15 +75,11 @@ function Table({headers, data,loading, maxHeight}) { ...@@ -75,15 +75,11 @@ function Table({headers, data,loading, maxHeight}) {
</table> </table>
{ {
(!data?.length)?<div className="w-full h-full"> (!data?.length)?<div className="w-full h-full">
<p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p> <p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No Records Found</p>
</div>:null </div>:null
} }
</div> </div>
); );
// else
// return <div className="w-full h-full">
// <p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
// </div>
} }
export default Table; export default Table;
...@@ -88,7 +88,7 @@ function Viewreportee() { ...@@ -88,7 +88,7 @@ function Viewreportee() {
} }
}, []); }, []);
if ( reportees.length && viewReportee!==null) if (viewReportee!==null)
return ( return (
<div className="p-4" > <div className="p-4" >
<div className="bg-white p-3 rounded-md"> <div className="bg-white p-3 rounded-md">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment