oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
@@ -14,10 +14,12 @@ export default function TerritoryGeometryPreview({
territoryId,
management = false,
endpoint: suppliedEndpoint,
label = 'Cobertura cartográfica da seleção',
}: {
territoryId?: string;
management?: boolean;
endpoint?: string;
label?: string;
}) {
const [context, setContext] = useState<Context | null>(null);
const [error, setError] = useState('');
@@ -26,9 +28,11 @@ export default function TerritoryGeometryPreview({
setError('');
if (!territoryId) return;
const controller = new AbortController();
const endpoint = suppliedEndpoint ?? (management
? '/management/territory-geometries'
: '/api/v1/investment/territory-geometries');
const endpoint =
suppliedEndpoint ??
(management
? '/management/territory-geometries'
: '/api/v1/investment/territory-geometries');
void fetch(
`${endpoint}?${new URLSearchParams({ territory_id: territoryId })}`,
{
@@ -56,10 +60,7 @@ export default function TerritoryGeometryPreview({
}, [territoryId, management, suppliedEndpoint]);
if (!territoryId) return null;
return (
<section
className="space-y-2 md:col-span-full"
aria-label="Cobertura cartográfica da seleção"
>
<section className="space-y-2 md:col-span-full" aria-label={label}>
<p>Território selecionado no cadastro.</p>
{error && <p role="alert">{error}</p>}
{!context && !error && <p role="status">A consultar geometria…</p>}