From 377c024e3334ef4461521ddecb18b94bdcc756cc Mon Sep 17 00:00:00 2001 From: "kartik.sharma" Date: Fri, 23 May 2025 14:25:04 +0530 Subject: [PATCH] Move all the Tasks-related code from the Dashboard component into a new component named 'Tasks'. --- src/components/Dashboard/Dashboard.jsx | 25 +++----------------- src/components/Dashboard/Tasks.jsx | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 src/components/Dashboard/Tasks.jsx diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index a352f5a5..8a702cd5 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -8,6 +8,7 @@ import { useDashboardTeamsCardData, useDashboardTasksCardData, } from "../../hooks/useDashboard_Data"; +import TasksCard from "./Tasks"; const Dashboard = () => { const { projects, loading } = useProjects(); @@ -145,28 +146,8 @@ const Dashboard = () => { {/* Tasks Card */} -
-
-
-
- Tasks -
-
-
-
-

- {tasksCardData.totalTasks?.toLocaleString()} -

- Total -
-
-

- {tasksCardData.completedTasks?.toLocaleString()} -

- Completed -
-
-
+
+ {/* Use the TasksCard component */}
{/* Bar Chart */} diff --git a/src/components/Dashboard/Tasks.jsx b/src/components/Dashboard/Tasks.jsx new file mode 100644 index 00000000..fa924036 --- /dev/null +++ b/src/components/Dashboard/Tasks.jsx @@ -0,0 +1,32 @@ +import React from "react"; +import { useDashboardTasksCardData } from "../../hooks/useDashboard_Data"; + +const TasksCard = () => { + const { tasksCardData } = useDashboardTasksCardData(); + + return ( +
+
+
+ Tasks +
+
+
+
+

+ {tasksCardData.totalTasks?.toLocaleString()} +

+ Total +
+
+

+ {tasksCardData.completedTasks?.toLocaleString()} +

+ Completed +
+
+
+ ); +}; + +export default TasksCard; \ No newline at end of file