Reconciliar fontes instaladas 423bd512d8c5 com main

This commit is contained in:
2026-10-20 14:45:19 +02:00
parent 507387502c
commit 9ab721c97f
108 changed files with 2766 additions and 494 deletions
@@ -1,3 +1,4 @@
import SearchState from '@/components/search-state';
import { useEffect, useState } from 'react';
import TerritoryGeometryPreview from './territory-geometry-preview';
import InteractiveInvestmentMap, {
@@ -18,11 +19,12 @@ export default function InvestmentMapPanel({
{ id: number; title: string; url: string }[]
>([]);
const [error, setError] = useState('');
const [retry, setRetry] = useState(0);
const [areas, setAreas] = useState<InvestmentMapArea[]>([]);
useEffect(() => {
const controller = new AbortController();
const params = new URLSearchParams(JSON.parse(key));
setPoints(null);
setPoints(null); setError(''); setMissing([]);
setAreas([]);
fetch(`/api/v1/investment/map?${params}`, {
signal: controller.signal,
@@ -43,14 +45,14 @@ export default function InvestmentMapPanel({
: '',
);
})
.catch((e) => {
if (!controller.signal.aborted) setError(e.message);
.catch(() => {
if (!controller.signal.aborted) setError('Não foi possível concluir a pesquisa.');
});
return () => controller.abort();
}, [key]);
}, [key, retry]);
return (
<section className="space-y-3">
{error && <p role="alert">{error}</p>}
<SearchState loading={points === null && !error} error={error} total={(points?.length ?? 0) + missing.length} retry={() => setRetry(value => value + 1)} />
<InteractiveInvestmentMap points={points} areas={areas} />
<TerritoryGeometryPreview
territoryId={