diff --git a/src/App.tsx b/src/App.tsx
index 183cf0d..22cf5e0 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -34,7 +34,7 @@ export default function App() {
return ;
case "home":
default:
- return ;
+ return ;
}
};
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index 887b3a5..36fee34 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -1,7 +1,16 @@
import { Cpu, Settings, BarChart3, Bell } from "lucide-react";
-import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid } from "recharts";
+import {
+ BarChart,
+ Bar,
+ XAxis,
+ YAxis,
+ Tooltip,
+ ResponsiveContainer,
+ CartesianGrid,
+} from "recharts";
+import { Page } from "../App";
-export default function Home() {
+export default function Home({ setPage }: { setPage: (page: Page) => void }) {
// Datos de ejemplo para empresas
const companies = [
{ name: "Empresa A", tomas: 12, alerts: 2, consumption: 320 },
@@ -18,19 +27,45 @@ export default function Home() {
// Historial tipo Google
const history = [
- { user: "GRH", action: "Creó un nuevo medidor", target: "SN001", time: "Hace 5 minutos" },
- { user: "CESPT", action: "Actualizó concentrador", target: "Planta 1", time: "Hace 20 minutos" },
- { user: "GRH", action: "Eliminó un usuario", target: "Juan Pérez", time: "Hace 1 hora" },
- { user: "CESPT", action: "Creó un payload", target: "Payload 12", time: "Hace 2 horas" },
- { user: "GRH", action: "Actualizó medidor", target: "SN002", time: "Hace 3 horas" },
+ {
+ user: "GRH",
+ action: "Creó un nuevo medidor",
+ target: "SN001",
+ time: "Hace 5 minutos",
+ },
+ {
+ user: "CESPT",
+ action: "Actualizó concentrador",
+ target: "Planta 1",
+ time: "Hace 20 minutos",
+ },
+ {
+ user: "GRH",
+ action: "Eliminó un usuario",
+ target: "Juan Pérez",
+ time: "Hace 1 hora",
+ },
+ {
+ user: "CESPT",
+ action: "Creó un payload",
+ target: "Payload 12",
+ time: "Hace 2 horas",
+ },
+ {
+ user: "GRH",
+ action: "Actualizó medidor",
+ target: "SN002",
+ time: "Hace 3 horas",
+ },
];
return (
-
{/* Título */}
-
Sistema de Tomas de Agua
+
+ Sistema de Tomas de Agua
+
Monitorea, administra y controla tus operaciones en un solo lugar.
@@ -38,7 +73,10 @@ export default function Home() {
{/* Cards de Secciones */}
-
+
setPage("meters")}
+ >
Tomas
@@ -64,8 +102,14 @@ export default function Home() {
className="bg-white rounded-xl shadow p-4 flex flex-col gap-1"
>
{c.name}
-
{c.tomas} Tomas
-
0 ? "text-red-500" : "text-green-500"}`}>
+
+ {c.tomas} Tomas
+
+ 0 ? "text-red-500" : "text-green-500"
+ }`}
+ >
{c.alerts} Alertas
@@ -74,10 +118,15 @@ export default function Home() {
{/* Gráfica de consumo */}
-
Consumo de Agua por Empresa
+
+ Consumo de Agua por Empresa
+
-
+
@@ -97,7 +146,8 @@ export default function Home() {
•
- {h.user} {h.action} {h.target}
+ {h.user} {h.action}{" "}
+ {h.target}
{h.time}
@@ -112,13 +162,14 @@ export default function Home() {
{alerts.map((a, i) => (
-
- {a.company} - {a.type}
+
+ {a.company} - {a.type}
+
{a.time}
))}
-
);
}