- Removed unnecessary comments and documentation from CardContainer, Header, HistoryCharts, MenuButton, PollutionMap, SideMenu, SummaryCards, and ThemeButton components. - Updated import paths to use aliasing for cleaner code. - Replaced the old context implementations (ConfigContext, DataContext, ThemeContext) with new hooks and context structure for better state management. - Introduced a new axios instance for API calls to streamline requests. - Added new utility functions for date and error parsing. - Updated the main entry point and pages to reflect new context and component structures. - Created new configuration files for development and production environments. - Enhanced data fetching logic with improved error handling and loading states.
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import PollutionMap from '@/components/PollutionMap.jsx'
|
|
import HistoryCharts from '@/components/HistoryCharts.jsx'
|
|
import SummaryCards from '@/components/SummaryCards.jsx'
|
|
|
|
import { useParams } from 'react-router-dom';
|
|
|
|
/**
|
|
* Dashboard.jsx
|
|
*
|
|
* Este archivo define el componente Dashboard, que es el panel de control de un device.
|
|
*
|
|
* Importaciones:
|
|
* - PollutionMap: Un componente que muestra un mapa de la contaminación.
|
|
* - HistoryCharts: Un componente que muestra gráficos históricos de la contaminación.
|
|
* - SummaryCards: Un componente que muestra tarjetas resumen con información relevante.
|
|
*
|
|
* Funcionalidad:
|
|
* - El componente Home utiliza una estructura de JSX para organizar y renderizar los componentes importados.
|
|
* - El componente Dashboard contiene los componentes SummaryCards, PollutionMap y HistoryCharts.
|
|
*
|
|
*/
|
|
|
|
const Dashboard = () => {
|
|
const { deviceId } = useParams();
|
|
|
|
return (
|
|
<main className='container justify-content-center'>
|
|
<SummaryCards deviceId={deviceId} />
|
|
<PollutionMap deviceId={deviceId}/>
|
|
<HistoryCharts deviceId={deviceId} />
|
|
</main>
|
|
);
|
|
}
|
|
|
|
export default Dashboard;
|