Primeiro commit
This commit is contained in:
78
src/pages/Dashboard.jsx
Executable file
78
src/pages/Dashboard.jsx
Executable file
@@ -0,0 +1,78 @@
|
||||
// src/pages/Dashboard.jsx
|
||||
import React from 'react';
|
||||
|
||||
const Dashboard = () => {
|
||||
// Mock data (substitua pelos dados reais)
|
||||
const mockDashboardData = {
|
||||
status: "Ativo",
|
||||
chargers: [
|
||||
{ id: 1, status: "Ativo", current: 12, power: 2200 },
|
||||
{ id: 2, status: "Inativo", current: 0, power: 0 },
|
||||
{ id: 3, status: "Erro", current: 0, power: 0 },
|
||||
],
|
||||
energyConsumed: 50.3,
|
||||
chargingTime: 120,
|
||||
alerts: ["Aviso: Carregador 1 está com erro."],
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="dashboard-container">
|
||||
<h1 className="dashboard-title">Visão Geral</h1>
|
||||
|
||||
{/* Cards com informações resumidas */}
|
||||
<div className="dashboard-summary">
|
||||
<div className="card">
|
||||
<h3>Status do Sistema</h3>
|
||||
<p>{mockDashboardData.status}</p>
|
||||
</div>
|
||||
<div className="card">
|
||||
<h3>Consumo de Energia</h3>
|
||||
<p>{mockDashboardData.energyConsumed} kWh</p>
|
||||
</div>
|
||||
<div className="card">
|
||||
<h3>Tempo de Carregamento</h3>
|
||||
<p>{mockDashboardData.chargingTime} minutos</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Indicadores de falhas ou alertas */}
|
||||
<div className="alerts">
|
||||
<h2>Alertas</h2>
|
||||
<ul>
|
||||
{mockDashboardData.alerts.map((alert, index) => (
|
||||
<li key={index} className="alert-item">
|
||||
<span>⚠️ {alert}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Tabela de Carregadores */}
|
||||
<div className="chargers-table">
|
||||
<h2>Carregadores</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Status</th>
|
||||
<th>Corrente (A)</th>
|
||||
<th>Potência (W)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{mockDashboardData.chargers.map((charger) => (
|
||||
<tr key={charger.id}>
|
||||
<td>{charger.id}</td>
|
||||
<td>{charger.status}</td>
|
||||
<td>{charger.current}</td>
|
||||
<td>{charger.power}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
||||
Reference in New Issue
Block a user