830 lines
36 KiB
TypeScript
830 lines
36 KiB
TypeScript
import InvestmentZoneInstallation, {
|
|
type ParkInstallationPlan,
|
|
} from '@/components/investment-zone-installation';
|
|
import { Link, router, usePage } from '@inertiajs/react';
|
|
import { searchTerritoryHref } from '@/lib/search-territory';
|
|
import { useEffect, useRef, useState } from 'react';
|
|
import { territorialSearchParams } from '@/lib/territorial-search-params';
|
|
import CatalogueFilterContext from '@/components/catalogue-filter-context';
|
|
import { catalogueDetailHref } from '@/lib/catalogue-context';
|
|
import {
|
|
TerritoryFields,
|
|
type TerritoryOption,
|
|
} from '@/components/investment-territory';
|
|
import { Frame, Field, input, button, card, api } from './shared';
|
|
|
|
type Zone = {
|
|
resources?: { name: string }[];
|
|
id: string;
|
|
code: string;
|
|
name: string;
|
|
category: string;
|
|
description: string | null;
|
|
province: string | null;
|
|
district: string | null;
|
|
version_no: number;
|
|
publication_status: string;
|
|
validation_status: string;
|
|
territory_path?: { id: string; name: string; location_type: string }[];
|
|
legal_regime?: string | null;
|
|
operational_status?: string;
|
|
development_status?: string;
|
|
availability_status?: string;
|
|
source_evidence?: {
|
|
title: string;
|
|
url: string;
|
|
source_type: string;
|
|
supports: string;
|
|
source_date?: string | null;
|
|
}[];
|
|
area_value?: string | null;
|
|
area_unit?: string | null;
|
|
activities?: { name: string; status: string }[];
|
|
locations?: {
|
|
id: string;
|
|
name: string;
|
|
location_type: string;
|
|
scope_type: string;
|
|
}[];
|
|
};
|
|
const parkLabels: Record<string, string> = {
|
|
pending: 'Por confirmar',
|
|
general: 'Geral',
|
|
not_applicable: 'Não aplicável',
|
|
unknown: 'Não informado',
|
|
not_informed: 'Não informada',
|
|
announced: 'Anunciado',
|
|
planned: 'Planeado',
|
|
in_development: 'Em desenvolvimento',
|
|
partially_operational: 'Parcialmente operacional',
|
|
operational: 'Operacional segundo o cadastro',
|
|
suspended: 'Suspenso',
|
|
confirmed: 'Confirmada segundo o cadastro',
|
|
unavailable: 'Indisponível',
|
|
reported_unverified: 'Declarada, não confirmada',
|
|
};
|
|
export default function Zones({
|
|
installation,
|
|
detailsInstallation,
|
|
records,
|
|
filters,
|
|
management,
|
|
zoneExtensionsAvailable = false,
|
|
territorySelection = [],
|
|
}: {
|
|
installation?: ParkInstallationPlan | null;
|
|
detailsInstallation?: ParkInstallationPlan | null;
|
|
records: {
|
|
data: Zone[];
|
|
total: number;
|
|
next_page_url: string | null;
|
|
prev_page_url: string | null;
|
|
from?: number | null;
|
|
to?: number | null;
|
|
current_page?: number;
|
|
last_page?: number;
|
|
};
|
|
filters: {
|
|
q?: string;
|
|
category?: string;
|
|
physical_category?: string;
|
|
legal_regime?: string;
|
|
development_status?: string;
|
|
availability_status?: string;
|
|
activity?: string;
|
|
};
|
|
management: boolean;
|
|
zoneExtensionsAvailable?: boolean;
|
|
territorySelection?: TerritoryOption[];
|
|
}) {
|
|
const pageUrl = usePage().url;
|
|
const [error, setError] = useState('');
|
|
const [busy, setBusy] = useState(false);
|
|
const searchForm = useRef<HTMLFormElement | null>(null);
|
|
const searchTimer = useRef<ReturnType<typeof setTimeout> | undefined>(
|
|
undefined,
|
|
);
|
|
const cancelSearch = useRef<(() => void) | undefined>(undefined);
|
|
const searchSequence = useRef(0);
|
|
const [searching, setSearching] = useState(false);
|
|
const [searchError, setSearchError] = useState('');
|
|
const appliedKey = JSON.stringify([filters, territorySelection]);
|
|
useEffect(() => {
|
|
searchForm.current?.reset();
|
|
}, [appliedKey]);
|
|
useEffect(
|
|
() => () => {
|
|
clearTimeout(searchTimer.current);
|
|
cancelSearch.current?.();
|
|
},
|
|
[],
|
|
);
|
|
const runSearch = (path?: TerritoryOption[]) => {
|
|
clearTimeout(searchTimer.current);
|
|
cancelSearch.current?.();
|
|
if (!searchForm.current) return;
|
|
const sequence = ++searchSequence.current;
|
|
const params = territorialSearchParams(
|
|
new FormData(searchForm.current),
|
|
path,
|
|
);
|
|
setSearching(true);
|
|
setSearchError('');
|
|
router.get(
|
|
`${management ? '/management/investment/zones' : '/zonas'}?${params}`,
|
|
{},
|
|
{
|
|
preserveState: true,
|
|
preserveScroll: true,
|
|
replace: true,
|
|
onCancelToken: (token) => {
|
|
cancelSearch.current = () => token.cancel();
|
|
},
|
|
onError: () => {
|
|
if (sequence === searchSequence.current)
|
|
setSearchError(
|
|
'A pesquisa não foi concluída. Confira os filtros e tente novamente.',
|
|
);
|
|
},
|
|
onNetworkError: () => {
|
|
if (sequence === searchSequence.current)
|
|
setSearchError(
|
|
'Ligação indisponível. Os filtros escolhidos foram preservados.',
|
|
);
|
|
return false;
|
|
},
|
|
onHttpException: () => {
|
|
if (sequence === searchSequence.current)
|
|
setSearchError(
|
|
'Não foi possível consultar esta selecção.',
|
|
);
|
|
return false;
|
|
},
|
|
onFinish: () => {
|
|
if (sequence === searchSequence.current)
|
|
setSearching(false);
|
|
},
|
|
},
|
|
);
|
|
};
|
|
const exportParams = new URLSearchParams();
|
|
['province_id', 'district_id', 'admin_post_id', 'locality_id'].forEach(
|
|
(field, index) => {
|
|
if (territorySelection[index])
|
|
exportParams.set(field, territorySelection[index].id);
|
|
},
|
|
);
|
|
for (const key of [
|
|
'q',
|
|
'category',
|
|
'physical_category',
|
|
'legal_regime',
|
|
'development_status',
|
|
'availability_status',
|
|
'activity',
|
|
] as const) {
|
|
const value = filters[key];
|
|
if (value) exportParams.set(key, value);
|
|
}
|
|
const territoryKeys: Record<string, string> = {
|
|
province: 'province_id',
|
|
district: 'district_id',
|
|
admin_post: 'admin_post_id',
|
|
locality: 'locality_id',
|
|
};
|
|
territorySelection.forEach((item) => {
|
|
const key = territoryKeys[item.location_type];
|
|
if (key) exportParams.set(key, item.id);
|
|
});
|
|
return (
|
|
<Frame
|
|
title={
|
|
management
|
|
? 'Gestão de ZEE, ZFI e parques'
|
|
: 'ZEE, ZFI e parques industriais'
|
|
}
|
|
>
|
|
{management && installation && (
|
|
<InvestmentZoneInstallation initial={installation} />
|
|
)}
|
|
{management && detailsInstallation && (
|
|
<InvestmentZoneInstallation
|
|
initial={detailsInstallation}
|
|
endpoint="/management/investment/zones/operational-install"
|
|
title="Complemento operacional L1 dos parques"
|
|
summary="Uma coluna de detalhes, com dados privados cifrados e projeção pública separada. Sem importação ou publicação de fichas."
|
|
/>
|
|
)}
|
|
<p>
|
|
A informação territorial não atribui benefícios nem substitui
|
|
certificados ou decisões das entidades competentes.
|
|
</p>
|
|
<details className="rounded border p-3">
|
|
<summary className="cursor-pointer font-semibold">
|
|
Catálogos relacionados
|
|
</summary>
|
|
<nav
|
|
aria-label="Dimensões de investimento"
|
|
className="flex flex-wrap gap-4 underline"
|
|
>
|
|
<Link href="/clusters">Por Cluster</Link>
|
|
<Link href="/corredores">Por Corredor</Link>
|
|
<Link
|
|
href={searchTerritoryHref(
|
|
'/zonas?category=zee',
|
|
pageUrl,
|
|
)}
|
|
>
|
|
Por ZEE
|
|
</Link>
|
|
<Link
|
|
href={searchTerritoryHref(
|
|
'/zonas?category=zfi',
|
|
pageUrl,
|
|
)}
|
|
>
|
|
Por ZFI
|
|
</Link>
|
|
<Link
|
|
href={searchTerritoryHref(
|
|
'/zonas?category=industrial_park',
|
|
pageUrl,
|
|
)}
|
|
>
|
|
Parques industriais
|
|
</Link>
|
|
</nav>
|
|
</details>
|
|
<CatalogueFilterContext />
|
|
<form
|
|
ref={searchForm}
|
|
method="get"
|
|
onChange={(event) => {
|
|
if (!event.target.getAttribute('name')) return;
|
|
clearTimeout(searchTimer.current);
|
|
cancelSearch.current?.();
|
|
searchSequence.current++;
|
|
setSearching(true);
|
|
setSearchError('');
|
|
searchTimer.current = setTimeout(() => runSearch(), 350);
|
|
}}
|
|
onSubmit={(event) => {
|
|
event.preventDefault();
|
|
runSearch();
|
|
}}
|
|
className={card + ' grid gap-4 md:grid-cols-3'}
|
|
>
|
|
<Field label="Pesquisar por nome ou código">
|
|
<input
|
|
className={input}
|
|
name="q"
|
|
defaultValue={filters.q}
|
|
maxLength={120}
|
|
/>
|
|
</Field>
|
|
<Field label="Grupo">
|
|
<select
|
|
className={input}
|
|
name="category"
|
|
defaultValue={filters.category ?? ''}
|
|
>
|
|
<option value="">Todas</option>
|
|
<option value="zee">ZEE</option>
|
|
<option value="zfi">ZFI</option>
|
|
<option value="industrial_park">
|
|
Parque industrial
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
<details className="w-full rounded border p-3">
|
|
<summary className="cursor-pointer font-semibold">
|
|
Mais filtros
|
|
</summary>
|
|
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
<Field label="Tipo de espaço">
|
|
<select
|
|
className={input}
|
|
name="physical_category"
|
|
defaultValue={filters.physical_category ?? ''}
|
|
>
|
|
<option value="">Todas</option>
|
|
<option value="industrial_park">
|
|
Parque industrial
|
|
</option>
|
|
{zoneExtensionsAvailable && (
|
|
<>
|
|
<option value="agro_industrial_park">
|
|
Parque agro-industrial
|
|
</option>
|
|
<option value="industrial_logistics_park">
|
|
Parque industrial e logístico
|
|
</option>
|
|
</>
|
|
)}
|
|
<option value="industrial_free_zone">
|
|
ZFI
|
|
</option>
|
|
<option value="economic_zone">ZEE</option>
|
|
</select>
|
|
</Field>
|
|
<Field label="Actividade documentada">
|
|
<input
|
|
className={input}
|
|
name="activity"
|
|
defaultValue={filters.activity}
|
|
maxLength={120}
|
|
/>
|
|
</Field>
|
|
<Field label="Regime jurídico">
|
|
<select
|
|
className={input}
|
|
name="legal_regime"
|
|
defaultValue={filters.legal_regime ?? ''}
|
|
>
|
|
<option value="">Todos</option>
|
|
<option value="zee">ZEE</option>
|
|
<option value="zfi">ZFI</option>
|
|
<option value="general">Regime geral</option>
|
|
<option value="pending">Por confirmar</option>
|
|
</select>
|
|
</Field>
|
|
{zoneExtensionsAvailable && (
|
|
<Field label="Desenvolvimento">
|
|
<select
|
|
className={input}
|
|
name="development_status"
|
|
defaultValue={
|
|
filters.development_status ?? ''
|
|
}
|
|
>
|
|
<option value="">Todos</option>
|
|
<option value="announced">Anunciado</option>
|
|
<option value="planned">Planeado</option>
|
|
<option value="in_development">
|
|
Em desenvolvimento
|
|
</option>
|
|
<option value="partially_operational">
|
|
Parcialmente operacional
|
|
</option>
|
|
<option value="operational">
|
|
Operacional
|
|
</option>
|
|
<option value="unknown">
|
|
Por confirmar
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
)}
|
|
{zoneExtensionsAvailable && (
|
|
<Field label="Disponibilidade">
|
|
<select
|
|
className={input}
|
|
name="availability_status"
|
|
defaultValue={
|
|
filters.availability_status ?? ''
|
|
}
|
|
>
|
|
<option value="">Todas</option>
|
|
<option value="confirmed">
|
|
Confirmada
|
|
</option>
|
|
<option value="unavailable">
|
|
Indisponível
|
|
</option>
|
|
<option value="reported_unverified">
|
|
Reportada, por verificar
|
|
</option>
|
|
<option value="not_informed">
|
|
Não informada
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
)}
|
|
</div>
|
|
</details>
|
|
<TerritoryFields
|
|
initial={territorySelection}
|
|
onChange={(path) => runSearch(path)}
|
|
/>
|
|
<button
|
|
type="button"
|
|
className="underline"
|
|
onClick={() => runSearch([])}
|
|
>
|
|
Todo o território (remover localização)
|
|
</button>
|
|
<button className={button}>Pesquisar</button>
|
|
</form>
|
|
<h2 className="text-xl font-semibold">
|
|
{searching
|
|
? 'A pesquisar a selecção…'
|
|
: searchError
|
|
? 'Pesquisa por concluir'
|
|
: `${records.total} registos disponíveis · ${territorySelection.length ? territorySelection.map((node) => node.name).join(' / ') : 'Todo o território'}`}
|
|
</h2>
|
|
{!searching && !searchError && records.total > 0 && (
|
|
<p>
|
|
A mostrar {records.from ?? 1} a{' '}
|
|
{records.to ?? records.data.length} de {records.total}.
|
|
Página {records.current_page ?? 1} de{' '}
|
|
{records.last_page ?? 1}.
|
|
</p>
|
|
)}
|
|
{searchError && <p role="alert">{searchError}</p>}
|
|
{!management && !searching && !searchError && (
|
|
<a
|
|
className="underline"
|
|
href={`/api/v2/investment/zones/export.csv?${exportParams.toString()}`}
|
|
>
|
|
Exportar resultados filtrados (CSV)
|
|
</a>
|
|
)}
|
|
{!searching && !searchError && !records.total && (
|
|
<p className={card}>
|
|
Não foram encontrados resultados para esta pesquisa.
|
|
</p>
|
|
)}
|
|
{!searching &&
|
|
!searchError &&
|
|
records.data.map((zone) => (
|
|
<article className={card} key={zone.id}>
|
|
<h2 className="text-xl font-bold">
|
|
<Link
|
|
className="underline"
|
|
href={catalogueDetailHref(
|
|
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
|
exportParams.toString(),
|
|
pageUrl,
|
|
)}
|
|
>
|
|
{zone.name}
|
|
</Link>
|
|
</h2>
|
|
<Link
|
|
className="underline"
|
|
href={catalogueDetailHref(
|
|
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
|
exportParams.toString(),
|
|
pageUrl,
|
|
)}
|
|
>
|
|
Consultar ficha
|
|
</Link>
|
|
{!management && (
|
|
<Link
|
|
className="ml-4 underline"
|
|
href={searchTerritoryHref(
|
|
`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`,
|
|
pageUrl,
|
|
)}
|
|
>
|
|
Ver oportunidades associadas
|
|
</Link>
|
|
)}
|
|
<p>
|
|
{zone.code} ·{' '}
|
|
{zone.category === 'industrial_park'
|
|
? 'Parque industrial'
|
|
: zone.category.toUpperCase()}{' '}
|
|
·{' '}
|
|
{[zone.district, zone.province]
|
|
.filter(Boolean)
|
|
.join(', ') || 'Localização por confirmar'}
|
|
</p>
|
|
{zone.legal_regime && (
|
|
<p>
|
|
Regime jurídico:{' '}
|
|
{parkLabels[zone.legal_regime] ??
|
|
(['zee', 'zfi'].includes(zone.legal_regime)
|
|
? zone.legal_regime.toUpperCase()
|
|
: 'Por confirmar')}
|
|
</p>
|
|
)}
|
|
{zoneExtensionsAvailable && zone.development_status && (
|
|
<p>
|
|
Desenvolvimento:{' '}
|
|
{parkLabels[zone.development_status] ??
|
|
'Por confirmar'}
|
|
</p>
|
|
)}
|
|
{zoneExtensionsAvailable &&
|
|
zone.availability_status && (
|
|
<p>
|
|
Disponibilidade para instalação:{' '}
|
|
{parkLabels[zone.availability_status] ??
|
|
'Não informada'}
|
|
</p>
|
|
)}
|
|
{zone.area_value && (
|
|
<p>
|
|
Área indicada: {zone.area_value}{' '}
|
|
{zone.area_unit}
|
|
</p>
|
|
)}
|
|
{zone.locations?.length ? (
|
|
<p>
|
|
Abrangência:{' '}
|
|
{zone.locations
|
|
.map((location) => location.name)
|
|
.join(' · ')}
|
|
</p>
|
|
) : null}
|
|
{zone.activities?.length ? (
|
|
<p>
|
|
Actividades:{' '}
|
|
{zone.activities
|
|
.map(
|
|
(activity) =>
|
|
`${activity.name} (${({ potential: 'Potencial referido pela fonte', proposed: 'Proposta', authorized: 'Autorizada por documento', conditional: 'Condicionada', excluded: 'Excluída' } as Record<string, string>)[activity.status] ?? 'Por confirmar'})`,
|
|
)
|
|
.join(' · ')}
|
|
</p>
|
|
) : null}
|
|
{!!zone.source_evidence?.length && (
|
|
<p>
|
|
Fonte:{' '}
|
|
{zone.source_evidence.map((source, index) => (
|
|
<span key={source.url}>
|
|
{index > 0 ? ' · ' : ''}
|
|
<a
|
|
className="underline"
|
|
href={source.url}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
>
|
|
{source.title}
|
|
</a>
|
|
{source.source_date
|
|
? ` (${source.source_date})`
|
|
: ' (data da fonte não informada)'}{' '}
|
|
— {source.supports}
|
|
</span>
|
|
))}
|
|
</p>
|
|
)}
|
|
{zone.category === 'industrial_park' && (
|
|
<p>
|
|
{zone.resources?.length
|
|
? `${zone.resources.length} recursos descritos; consulte o âmbito e a fonte na ficha.`
|
|
: 'Infraestruturas, serviços, acessos e capacidades: não informados.'}{' '}
|
|
{!zone.activities?.length &&
|
|
'Atividades: não informadas.'}
|
|
</p>
|
|
)}
|
|
<p>{zone.description}</p>
|
|
{management && (
|
|
<p>Validação: {zone.validation_status}</p>
|
|
)}
|
|
{management && (
|
|
<p>
|
|
Versão {zone.version_no} ·{' '}
|
|
{zone.publication_status}
|
|
</p>
|
|
)}
|
|
</article>
|
|
))}
|
|
<nav aria-label="Paginação" className="flex gap-4 underline">
|
|
{!searching && !searchError && records.prev_page_url && (
|
|
<Link href={records.prev_page_url}>Anterior</Link>
|
|
)}
|
|
{!searching && !searchError && records.next_page_url && (
|
|
<Link href={records.next_page_url}>Seguinte</Link>
|
|
)}
|
|
</nav>
|
|
{management && (
|
|
<form
|
|
className={card + ' space-y-4'}
|
|
onSubmit={async (event) => {
|
|
event.preventDefault();
|
|
const data = Object.fromEntries(
|
|
new FormData(event.currentTarget),
|
|
);
|
|
setBusy(true);
|
|
setError('');
|
|
try {
|
|
await api('/api/v2/investment/admin/zones', data);
|
|
router.reload();
|
|
} catch (failure) {
|
|
setError(
|
|
failure instanceof Error
|
|
? failure.message
|
|
: 'Não foi possível guardar. Tente novamente.',
|
|
);
|
|
} finally {
|
|
setBusy(false);
|
|
}
|
|
}}
|
|
>
|
|
<h2 className="text-xl font-bold">Criar rascunho</h2>
|
|
<TerritoryFields endpoint="/management/territory-options" />
|
|
<Field label="Código">
|
|
<input
|
|
name="code"
|
|
className={input}
|
|
required
|
|
maxLength={80}
|
|
/>
|
|
</Field>
|
|
<Field label="Nome">
|
|
<input
|
|
name="name"
|
|
className={input}
|
|
required
|
|
maxLength={255}
|
|
/>
|
|
</Field>
|
|
<Field label="Categoria proposta">
|
|
<select name="category" className={input}>
|
|
<option value="pending">
|
|
Pendente de enquadramento
|
|
</option>
|
|
<option value="zee">ZEE</option>
|
|
<option value="zfi">ZFI</option>
|
|
<option value="industrial_park">
|
|
Parque industrial
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
<Field label="Categoria física">
|
|
<select
|
|
name="physical_category"
|
|
className={input}
|
|
defaultValue="unknown"
|
|
>
|
|
<option value="unknown">Por confirmar</option>
|
|
<option value="economic_zone">
|
|
Zona económica
|
|
</option>
|
|
<option value="industrial_park">
|
|
Parque industrial
|
|
</option>
|
|
{zoneExtensionsAvailable && (
|
|
<option value="agro_industrial_park">
|
|
Parque agro-industrial
|
|
</option>
|
|
)}
|
|
{zoneExtensionsAvailable && (
|
|
<option value="industrial_logistics_park">
|
|
Parque industrial e logístico
|
|
</option>
|
|
)}
|
|
<option value="industrial_free_zone">
|
|
Zona franca industrial
|
|
</option>
|
|
<option value="integrated_tourism_area">
|
|
Área de turismo integrado
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
{zoneExtensionsAvailable && (
|
|
<Field label="Estado de desenvolvimento">
|
|
<select
|
|
name="development_status"
|
|
className={input}
|
|
defaultValue="unknown"
|
|
>
|
|
<option value="unknown">Por confirmar</option>
|
|
<option value="announced">Anunciado</option>
|
|
<option value="planned">Planeado</option>
|
|
<option value="in_development">
|
|
Em desenvolvimento
|
|
</option>
|
|
<option value="partially_operational">
|
|
Parcialmente operacional
|
|
</option>
|
|
<option value="operational">Operacional</option>
|
|
<option value="suspended">Suspenso</option>
|
|
</select>
|
|
</Field>
|
|
)}
|
|
{zoneExtensionsAvailable && (
|
|
<Field label="Disponibilidade para instalação">
|
|
<select
|
|
name="availability_status"
|
|
className={input}
|
|
defaultValue="not_informed"
|
|
>
|
|
<option value="not_informed">
|
|
Não informada
|
|
</option>
|
|
<option value="confirmed">
|
|
Confirmada por fonte
|
|
</option>
|
|
<option value="unavailable">
|
|
Indisponível
|
|
</option>
|
|
<option value="reported_unverified">
|
|
Reportada, por verificar
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
)}
|
|
<Field label="Regime jurídico">
|
|
<select
|
|
name="legal_regime"
|
|
className={input}
|
|
defaultValue="pending"
|
|
>
|
|
<option value="pending">
|
|
Pendente de confirmação
|
|
</option>
|
|
<option value="zee">ZEE</option>
|
|
<option value="zfi">ZFI</option>
|
|
<option value="general">Regime geral</option>
|
|
<option value="not_applicable">
|
|
Não aplicável
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
<Field label="Área (valor) — se documentada">
|
|
<input
|
|
name="area_value"
|
|
className={input}
|
|
type="number"
|
|
min="0"
|
|
step="0.0001"
|
|
/>
|
|
</Field>
|
|
<Field label="Unidade da área">
|
|
<select
|
|
name="area_unit"
|
|
className={input}
|
|
defaultValue=""
|
|
>
|
|
<option value="">Por confirmar</option>
|
|
<option value="ha">hectares (ha)</option>
|
|
<option value="km2">
|
|
quilómetros quadrados (km²)
|
|
</option>
|
|
</select>
|
|
</Field>
|
|
<Field label="Actividade documentada (opcional)">
|
|
<input
|
|
name="activity_name"
|
|
className={input}
|
|
maxLength={300}
|
|
/>
|
|
</Field>
|
|
<Field label="Estado da actividade">
|
|
<select
|
|
name="activity_status"
|
|
className={input}
|
|
defaultValue="potential"
|
|
>
|
|
<option value="potential">
|
|
Potencial referido pela fonte
|
|
</option>
|
|
<option value="proposed">Proposta</option>
|
|
<option value="authorized">
|
|
Autorizada por documento
|
|
</option>
|
|
<option value="conditional">Condicionada</option>
|
|
<option value="excluded">Excluída</option>
|
|
</select>
|
|
</Field>
|
|
<Field label="Designações alternativas">
|
|
<textarea
|
|
name="aliases_text"
|
|
className={input}
|
|
rows={2}
|
|
placeholder="Uma por linha"
|
|
/>
|
|
</Field>
|
|
<Field label="Localização histórica (se diferente da actual)">
|
|
<input
|
|
name="historical_name"
|
|
className={input}
|
|
maxLength={255}
|
|
/>
|
|
</Field>
|
|
<Field label="Distrito histórico">
|
|
<input
|
|
name="historical_district"
|
|
className={input}
|
|
maxLength={120}
|
|
/>
|
|
</Field>
|
|
<Field label="Província histórica">
|
|
<input
|
|
name="historical_province"
|
|
className={input}
|
|
maxLength={120}
|
|
/>
|
|
</Field>
|
|
<Field label="Fonte da localização histórica">
|
|
<input
|
|
name="historical_source_reference"
|
|
className={input}
|
|
maxLength={2000}
|
|
/>
|
|
</Field>
|
|
{error && <p role="alert">{error}</p>}
|
|
<button className={button} disabled={busy}>
|
|
Guardar rascunho
|
|
</button>
|
|
</form>
|
|
)}
|
|
</Frame>
|
|
);
|
|
}
|