diff --git a/code/Software/Frontend/src/AdminDashboard/Dashboard.css b/code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.css
similarity index 51%
rename from code/Software/Frontend/src/AdminDashboard/Dashboard.css
rename to code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.css
index fe77942..5a26bfe 100644
--- a/code/Software/Frontend/src/AdminDashboard/Dashboard.css
+++ b/code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.css
@@ -24,24 +24,3 @@
padding: 40px;
}
-
- .container_for_topselling {
- display: flex;
- justify-content: center;
- align-items: center;
- max-width: 900px;
- border-radius: 25px;
-
- }
- .square-card_topselling {
- height: 90%;
- border-radius: 1px;
- aspect-ratio: 1/1;
- border-color: rgb(45, 49, 49);
- margin: 0;
- margin-top: 15px;
- height: 20vh;
- }
- .card-body_topselling{
- padding: 2px;
- }
\ No newline at end of file
diff --git a/code/Software/Frontend/src/AdminDashboard/Dashboard.jsx b/code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.jsx
similarity index 75%
rename from code/Software/Frontend/src/AdminDashboard/Dashboard.jsx
rename to code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.jsx
index 6686f8f..1c06407 100644
--- a/code/Software/Frontend/src/AdminDashboard/Dashboard.jsx
+++ b/code/Software/Frontend/src/AdminDashboard/Dashboard/Dashboard.jsx
@@ -3,6 +3,8 @@ import React, { useState, useEffect } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faShoppingCart, faDollarSign, faChartBar } from '@fortawesome/free-solid-svg-icons';
import './Dashboard.css';
+import TopProducts from './TopProducts';
+import TopSellingProducts from './TopSellingProducts';
const Dashboard = () => {
@@ -11,7 +13,7 @@ const Dashboard = () => {
const [totalSaleYesterday, setTotalSaleYesterday] = useState(0);
const [percentageChange, setPercentageChange] = useState(0);
- const [totalBillToday, setTotalBillToday] = useState(0);
+ const [billCountToday, setTotalBillToday] = useState(0);
const [totalBillYesterday, setTotalBillYesterday] = useState(0);
const [percentageChangeBills, setPercentageChangeBills] = useState(0);
@@ -43,10 +45,11 @@ const Dashboard = () => {
console.log(data);
// Destructure data and set state for bills
- const { totalBillToday, totalBillYesterday, percentageChange } = data;
- setTotalBillToday(totalBillToday);
+ const { billCountToday, totalBillYesterday, percentageChange } = data;
+ setTotalBillToday(billCountToday);
setTotalBillYesterday(totalBillYesterday);
setPercentageChangeBills(percentageChange);
+
} catch (error) {
console.error('Error fetching bill data:', error);
}
@@ -102,7 +105,7 @@ const Dashboard = () => {
-
{totalBillToday}
+
{billCountToday}
Total Bills
{percentageChangeBills}% from yesterday
@@ -125,43 +128,9 @@ const Dashboard = () => {