11"use client" ;
22import React from "react" ;
33import "react-datepicker/dist/react-datepicker.css" ;
4- import { BarChart , Bar , XAxis , YAxis , CartesianGrid , Tooltip , LineChart , Line , ResponsiveContainer , } from "recharts" ;
5- import { IoSettingsOutline , IoPersonOutline } from "react-icons/io5" ;
4+ import {
5+ BarChart ,
6+ Bar ,
7+ XAxis ,
8+ YAxis ,
9+ CartesianGrid ,
10+ Tooltip ,
11+ LineChart ,
12+ Line ,
13+ ResponsiveContainer ,
14+ } from "recharts" ;
15+ import { IoPersonOutline } from "react-icons/io5" ;
616import { useFetchEmission } from "../hooks/useFetchEmissions" ;
717import { useFetchEnergyEntries } from "../hooks/useFetchEnergyEntries" ;
818import Link from "next/link" ;
@@ -24,13 +34,10 @@ export default function DashboardPage() {
2434 < FactoryLayout >
2535 < div className = "bg-black text-white w-full min-h-screen flex flex-col" >
2636 < MqttSubscriber />
27- < main className = "flex-1 p-4 md:p-8 overflow-auto w-full max-w-7xl mx-auto" >
37+ < main className = "flex-1 p-4 md:p-8 overflow-auto w-full max-w-9xl mx-auto" >
2838 < div className = "flex justify-end space-x-4 mb-4" >
29- < Link href = "" >
30- < IoSettingsOutline className = "text-[#F79B72] w-7 h-7 cursor-pointer hover:text-[#2A4759]" />
31- </ Link >
3239 < Link href = "/factory-profile" >
33- < IoPersonOutline className = "text-[#F79B72] w-7 h-7 cursor-pointer hover:text-[#2A4759]" />
40+ < IoPersonOutline className = "text-[#F79B72] 2xl: w-7 2xl: h-7 xl:w-7 xl:h-7 lg:w-5 lg:h-5 cursor-pointer hover:text-[#2A4759]" />
3441 </ Link >
3542 </ div >
3643 < h2 className = "text-2xl font-bold mb-2 truncate" > Factory Dashboard</ h2 >
@@ -48,8 +55,8 @@ export default function DashboardPage() {
4855 }
4956 } }
5057 />
51- < div className = "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6 mb-8" >
52- < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
58+ < div className = "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6 2xl: mb-8 xl:mb-8 lg:mb-4 " >
59+ < div className = "bg-slate-700 xl:p-6 lg:p-3 p-6 2xl: p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
5360 < p className = "text-gray-300" > Today’s total CO2 emissions</ p >
5461 < p className = "text-2xl font-bold mt-2 truncate" >
5562 { emissionsLoading
@@ -59,7 +66,7 @@ export default function DashboardPage() {
5966 : "No data" }
6067 </ p >
6168 </ div >
62- < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
69+ < div className = "bg-slate-700 xl:p-6 lg:p-3 p-6 2xl: p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
6370 < p className = "text-gray-300" > This month total CO2 emissions</ p >
6471 < p className = "text-2xl font-bold mt-2 truncate" >
6572 { monthTotal !== null
@@ -69,7 +76,7 @@ export default function DashboardPage() {
6976 : "No data" }
7077 </ p >
7178 </ div >
72- < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
79+ < div className = "bg-slate-700 xl:p-6 lg:p-3 p-6 2xl: p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300" >
7380 < p className = "text-gray-300" > Indirect Emissions</ p >
7481 < p className = "text-2xl font-bold mt-2 truncate" >
7582 { totalCO2 !== null
@@ -81,7 +88,9 @@ export default function DashboardPage() {
8188 </ div >
8289 </ div >
8390 < div className = "grid grid-cols-1 md:grid-cols-2 gap-8" >
84- < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300 w-full h-56 sm:h-72 md:h-96" >
91+ < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300 w-full
92+ h-56 sm:h-72 2xl:h-126 xl:h-94
93+ lg:h-60 md:h-54" >
8594 < h3 className = "text-xl font-semibold mb-4 text-white truncate" >
8695 CO2 Levels Over Time
8796 </ h3 >
@@ -104,7 +113,9 @@ export default function DashboardPage() {
104113 </ BarChart >
105114 </ ResponsiveContainer >
106115 </ div >
107- < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300 w-full h-56 sm:h-72 md:h-96" >
116+ < div className = "bg-slate-700 p-6 rounded-lg shadow hover:shadow-lg transition-shadow duration-300 w-full
117+ h-56 sm:h-72 2xl:h-126 xl:h-94
118+ lg:h-60 md:h-54" >
108119 < h3 className = "text-xl font-semibold mb-4 text-white truncate" >
109120 Current CO2 Emissions
110121 </ h3 >
@@ -126,4 +137,4 @@ export default function DashboardPage() {
126137 </ div >
127138 </ FactoryLayout >
128139 ) ;
129- }
140+ }
0 commit comments