import React from "react"; import { useSelector } from "react-redux"; import { useDashboardProjectsCardData, useDashboardTeamsCardData, useDashboardTasksCardData, useAttendanceOverviewData, useGetCollectionOverview, } from "../../hooks/useDashboard_Data"; import Projects from "./Projects"; import Teams from "./Teams"; import TasksCard from "./Tasks"; import ProjectCompletionChart from "./ProjectCompletionChart"; import ProjectProgressChart from "./ProjectProgressChart"; import AttendanceOverview from "./AttendanceOverview"; import ExpenseAnalysis from "./ExpenseAnalysis"; import ExpenseStatus from "./ExpenseStatus"; import ExpenseByProject from "./ExpenseByProject"; import ProjectStatistics from "../Project/ProjectStatistics"; import ServiceJobs from "./ServiceJobs"; import { useHasUserPermission } from "../../hooks/useHasUserPermission"; import { REGULARIZE_ATTENDANCE, SELF_ATTENDANCE, TEAM_ATTENDANCE, } from "../../utils/constants"; import CollectionOverview, { TopicBarChart } from "./CollectionOverview"; import { CollectionOverviewSkeleton } from "./CollectionOverviewSkeleton"; const Dashboard = () => { // Get the selected project ID from Redux store const projectId = useSelector((store) => store.localVariables.projectId); const isAllProjectsSelected = projectId === null; const canRegularize = useHasUserPermission(REGULARIZE_ATTENDANCE); const canTeamAttendance = useHasUserPermission(TEAM_ATTENDANCE); const canSelfAttendance = useHasUserPermission(SELF_ATTENDANCE); const { data, isLoading, isError } = useGetCollectionOverview(); console.log("data-->", data); return (
{isAllProjectsSelected && (
)}
{isAllProjectsSelected && (
)}
{!isAllProjectsSelected && (canRegularize || canTeamAttendance || canSelfAttendance) && (
)} {!isAllProjectsSelected && (
)} {isAllProjectsSelected && (
)}
{isLoading ? ( ) : ( data && (
) )}
); }; export default Dashboard; //
//
//
//
Topic you are interested in
// //
//
//
//
//
//
//
//
// //
//

UI Design

//
35%
//
//
//
// //
//

Music

//
14%
//
//
//
// //
//

React

//
10%
//
//
//
//
//
// //
//

UX Design

//
20%
//
//
//
// //
//

Animation

//
12%
//
//
//
// //
//

SEO

//
9%
//
//
//
//
//
//
//