Feat Widgets Tickers

This commit is contained in:
2025-09-02 17:08:56 -03:00
parent 6ac6034255
commit 9393d2bc05
12 changed files with 203 additions and 62 deletions

View File

@@ -2,7 +2,7 @@
import { useState, useMemo, useEffect } from 'react';
import { useQuery } from '@tanstack/react-query';
import Select from 'react-select'; // <-- 1. Importar react-select
import { getMunicipios, getResultadosConcejalesPorMunicipio, getConfiguracionPublica } from '../apiService';
import { getMunicipios, getResultadosPorMunicipioYCategoria, getConfiguracionPublica } from '../apiService';
import type { MunicipioSimple, ResultadoTicker } from '../types/types';
import { ImageWithFallback } from './ImageWithFallback';
import './TickerWidget.css';
@@ -58,7 +58,7 @@ export const ConcejalesWidget = () => {
// 5. Query para obtener los resultados del MUNICIPIO seleccionado
const { data: resultados, isLoading: isLoadingResultados } = useQuery<ResultadoTicker[]>({
queryKey: ['resultadosConcejalesPorMunicipio', selectedMunicipio?.value],
queryFn: () => getResultadosConcejalesPorMunicipio(selectedMunicipio!.value),
queryFn: () => getResultadosPorMunicipioYCategoria(selectedMunicipio!.value, 7),
enabled: !!selectedMunicipio,
});