diff --git a/src/components/Dashboard/AttendanceChart.jsx b/src/components/Dashboard/AttendanceChart.jsx index ea3e2ba4..71d14e48 100644 --- a/src/components/Dashboard/AttendanceChart.jsx +++ b/src/components/Dashboard/AttendanceChart.jsx @@ -118,18 +118,16 @@ const AttendanceOverview = () => { Last 30 Days setView("chart")} title="Chart View" > setView("table")} title="Table View" > @@ -144,6 +142,9 @@ const AttendanceOverview = () => { ) : error ? ( {error} + ) : attendanceOverviewData.length === 0 || + attendanceOverviewData.every((item) => item.present === 0) ? ( + No data found ) : view === "chart" ? ( { style={{ position: "sticky", top: 0, zIndex: 1 }} > - - Role - + Role {dates.map((date, idx) => ( { ))} - {roles.map((role) => ( {role} {tableData.map((row, idx) => { const value = row[role]; - const cellStyle = - value > 0 ? { backgroundColor: "#d5d5d5" } : {}; + const cellStyle = value > 0 ? { backgroundColor: "#d5d5d5" } : {}; return ( {value} diff --git a/src/components/Dashboard/ExpenseByProject.jsx b/src/components/Dashboard/ExpenseByProject.jsx index 9d617efe..37b9d211 100644 --- a/src/components/Dashboard/ExpenseByProject.jsx +++ b/src/components/Dashboard/ExpenseByProject.jsx @@ -86,12 +86,12 @@ const ExpenseByProject = () => { {/* Header */} - + Monthly Expense - {projectName} - + { {/* Chart */} - + {isLoading ? ( ) : !expenseApiData || expenseApiData.length === 0 ? ( - No data found + No data found ) : ( )}
{error}
{projectName}