diff --git a/src/components/Activities/InfraPlanning.jsx b/src/components/Activities/InfraPlanning.jsx index e7a4003a..08f03a93 100644 --- a/src/components/Activities/InfraPlanning.jsx +++ b/src/components/Activities/InfraPlanning.jsx @@ -24,8 +24,7 @@ import { useProfile } from "../../hooks/useProfile"; import { refreshData, setProjectId } from "../../slices/localVariablesSlice"; import InfraTable from "../Project/Infrastructure/InfraTable"; import { useSelectedProject } from "../../slices/apiDataManager"; -import Loader from "../common/Loader"; - +import { SpinnerLoader } from "../common/Loader"; const InfraPlanning = () => { const { profile: LoggedUser, refetch: fetchData } = useProfile(); const dispatch = useDispatch(); @@ -57,7 +56,14 @@ const InfraPlanning = () => { } if (isLoading) { - return ; + return ( +
+ +
+ ); } if (isFetched && (!projectInfra || projectInfra.length === 0)) { diff --git a/src/components/Charts/HorizontalBarChart.jsx b/src/components/Charts/HorizontalBarChart.jsx index 5aec5e12..c28778fc 100644 --- a/src/components/Charts/HorizontalBarChart.jsx +++ b/src/components/Charts/HorizontalBarChart.jsx @@ -30,7 +30,6 @@ const HorizontalBarChart = ({ > - {/* Replace this with a skeleton or spinner if you prefer */} ); } diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index ae7c9f37..92465d13 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -99,7 +99,7 @@ const ExpenseAnalysis = () => { {isLoading && (
diff --git a/src/components/Dashboard/ExpenseByProject.jsx b/src/components/Dashboard/ExpenseByProject.jsx index 96e3fb56..6dc2f49a 100644 --- a/src/components/Dashboard/ExpenseByProject.jsx +++ b/src/components/Dashboard/ExpenseByProject.jsx @@ -7,6 +7,7 @@ import { formatCurrency } from "../../utils/appUtils"; import { formatDate_DayMonth } from "../../utils/dateUtils"; import { useProjectName } from "../../hooks/useProjects"; import { useSelectedProject } from "../../slices/apiDataManager"; +import { SpinnerLoader } from "../common/Loader"; const ExpenseByProject = () => { const projectId = useSelector((store) => store.localVariables.projectId); @@ -161,14 +162,17 @@ const ExpenseByProject = () => { {/* Chart */} -
+
{isLoading ? ( -

Loading chart...

+
+ +
) : !expenseApiData || expenseApiData.length === 0 ? (
No data found
) : ( )} +
diff --git a/src/components/Employee/EmpActivities.jsx b/src/components/Employee/EmpActivities.jsx index e79b181d..8d23b68a 100644 --- a/src/components/Employee/EmpActivities.jsx +++ b/src/components/Employee/EmpActivities.jsx @@ -12,13 +12,13 @@ const EmpActivities = ({ employee }) => { const { data, -isError, -isLoading, -error, + isError, + isLoading, + error, refetch, - } = useProjectTasksByEmployee(employee?.id,dateRange.startDate,dateRange.endDate); + } = useProjectTasksByEmployee(employee?.id, dateRange.startDate, dateRange.endDate); - if(isLoading) return
Loading...
+ if (isLoading) return
Loading...
return ( <>
@@ -31,28 +31,28 @@ error, />