Compare commits
	
		
			2 Commits
		
	
	
		
			66d14247cf
			...
			75ff9d5593
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 75ff9d5593 | |||
| bed4a4a638 | 
| @@ -1,27 +1,14 @@ | |||||||
| // src/App.tsx | // src/App.tsx | ||||||
| import { useState, useEffect } from 'react'; | import { useState } from 'react'; | ||||||
| import { MunicipioWidget } from './components/MunicipioWidget'; | import { MunicipioWidget } from './components/MunicipioWidget'; | ||||||
| import { MunicipioSelector } from './components/MunicipioSelector'; | import { MunicipioSelector } from './components/MunicipioSelector'; | ||||||
| import { getMunicipios, type MunicipioSimple } from './services/api'; |  | ||||||
| import './App.css'; | import './App.css'; | ||||||
| import { ResumenProvincialWidget } from './components/ResumenProvincialWidget'; | import { ResumenProvincialWidget } from './components/ResumenProvincialWidget'; | ||||||
| import { BancasWidget } from './components/BancasWidget'; | import { BancasWidget } from './components/BancasWidget'; | ||||||
| import { TelegramasView } from './components/TelegramasView'; | import { TelegramasView } from './components/TelegramasView'; | ||||||
| import { MapaD3Widget } from './components/MapaD3Widget'; |  | ||||||
|  |  | ||||||
| function App() { | function App() { | ||||||
|   const [selectedMunicipioId, setSelectedMunicipioId] = useState<string | null>(null); |   const [selectedMunicipioId, setSelectedMunicipioId] = useState<string | null>(null); | ||||||
|   const [listaMunicipios, setListaMunicipios] = useState<MunicipioSimple[]>([]); |  | ||||||
|   const [loading, setLoading] = useState(true); |  | ||||||
|  |  | ||||||
|   useEffect(() => { |  | ||||||
|     getMunicipios() |  | ||||||
|       .then(setListaMunicipios) |  | ||||||
|       .catch(err => console.error("Error al cargar la lista de municipios", err)) |  | ||||||
|       .finally(() => setLoading(false)); |  | ||||||
|   }, []); |  | ||||||
|  |  | ||||||
|   if (loading) return <h1>Cargando datos iniciales...</h1>; |  | ||||||
|  |  | ||||||
|   return ( |   return ( | ||||||
|     <> |     <> | ||||||
| @@ -32,27 +19,7 @@ function App() { | |||||||
|  |  | ||||||
|       <hr /> |       <hr /> | ||||||
|        |        | ||||||
|       <section style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: '20px' }}> |        | ||||||
|         <div> |  | ||||||
|           <h2>Mapa de Resultados</h2> |  | ||||||
|           <MapaD3Widget |  | ||||||
|             municipios={listaMunicipios}  |  | ||||||
|             onMunicipioClick={setSelectedMunicipioId}  |  | ||||||
|           /> |  | ||||||
|         </div> |  | ||||||
|         <div> |  | ||||||
|           <h2>Consulta por Municipio</h2> |  | ||||||
|           <MunicipioSelector  |  | ||||||
|             municipios={listaMunicipios}  |  | ||||||
|             onMunicipioChange={setSelectedMunicipioId}  |  | ||||||
|           /> |  | ||||||
|           {selectedMunicipioId && ( |  | ||||||
|             <div style={{ marginTop: '20px' }}> |  | ||||||
|               <MunicipioWidget municipioId={selectedMunicipioId} /> |  | ||||||
|             </div> |  | ||||||
|           )} |  | ||||||
|         </div> |  | ||||||
|       </section> |  | ||||||
|        |        | ||||||
|       <section> |       <section> | ||||||
|         {/* Usamos el ID del distrito de Bs As ("02") */} |         {/* Usamos el ID del distrito de Bs As ("02") */} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user