@@ -1,9 +1,9 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import TerritoryGeometryPreview from "./territory-geometry-preview";
|
||||
import { useEffect, useState } from 'react';
|
||||
import TerritoryGeometryPreview from './territory-geometry-preview';
|
||||
import InteractiveInvestmentMap, {
|
||||
type InvestmentMapFeature,
|
||||
type InvestmentMapArea,
|
||||
} from "./interactive-investment-map";
|
||||
} from './interactive-investment-map';
|
||||
|
||||
export default function InvestmentMapPanel({
|
||||
filters,
|
||||
@@ -17,7 +17,7 @@ export default function InvestmentMapPanel({
|
||||
const [missing, setMissing] = useState<
|
||||
{ id: number; title: string; url: string }[]
|
||||
>([]);
|
||||
const [error, setError] = useState("");
|
||||
const [error, setError] = useState('');
|
||||
const [areas, setAreas] = useState<InvestmentMapArea[]>([]);
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
@@ -26,10 +26,10 @@ export default function InvestmentMapPanel({
|
||||
setAreas([]);
|
||||
fetch(`/api/v1/investment/map?${params}`, {
|
||||
signal: controller.signal,
|
||||
headers: { Accept: "application/json" },
|
||||
headers: { Accept: 'application/json' },
|
||||
})
|
||||
.then(async (response) => {
|
||||
if (!response.ok) throw new Error("Mapa indisponível.");
|
||||
if (!response.ok) throw new Error('Mapa indisponível.');
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -39,8 +39,8 @@ export default function InvestmentMapPanel({
|
||||
setMissing(data.unlocated ?? []);
|
||||
setError(
|
||||
data.truncated
|
||||
? "Cobertura limitada: refine os filtros."
|
||||
: "",
|
||||
? 'Cobertura limitada: refine os filtros.'
|
||||
: '',
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
@@ -61,7 +61,7 @@ export default function InvestmentMapPanel({
|
||||
filters.district_id ||
|
||||
filters.province_id ||
|
||||
filters.geo_location_id ||
|
||||
"",
|
||||
'',
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user