@@ -24,13 +24,24 @@ const titles: Record<string, string> = {
|
||||
desk: 'Balcão Virtual',
|
||||
};
|
||||
const documentTypeLabels: Record<string, string> = {
|
||||
legislation: 'Legislação', procedure: 'Procedimento oficial', official_form: 'Formulário oficial',
|
||||
digital_adaptation: 'Adaptação digital de formulário', guidance_template: 'Modelo orientativo',
|
||||
guide: 'Guia', study: 'Estudo', reference_data: 'Dados de referência', unknown: 'Tipo por classificar',
|
||||
legislation: 'Legislação',
|
||||
procedure: 'Procedimento oficial',
|
||||
official_form: 'Formulário oficial',
|
||||
digital_adaptation: 'Adaptação digital de formulário',
|
||||
guidance_template: 'Modelo orientativo',
|
||||
guide: 'Guia',
|
||||
study: 'Estudo',
|
||||
reference_data: 'Dados de referência',
|
||||
unknown: 'Tipo por classificar',
|
||||
};
|
||||
const legalStatusLabels: Record<string, string> = {
|
||||
not_applicable: 'Não aplicável', in_force: 'Vigência indicada; confirme o período', historical: 'Histórico',
|
||||
proposed: 'Proposta; não é norma vigente', repealed: 'Revogada', amended: 'Alterada; consulte alterações posteriores', unknown: 'Por confirmar',
|
||||
not_applicable: 'Não aplicável',
|
||||
in_force: 'Vigência indicada; confirme o período',
|
||||
historical: 'Histórico',
|
||||
proposed: 'Proposta; não é norma vigente',
|
||||
repealed: 'Revogada',
|
||||
amended: 'Alterada; consulte alterações posteriores',
|
||||
unknown: 'Por confirmar',
|
||||
};
|
||||
type Resource = {
|
||||
id: number;
|
||||
@@ -410,7 +421,13 @@ function PartnershipForm() {
|
||||
function Simulator() {
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
<p><Link href="/como-investir" className="underline">Voltar ao roteiro de investimento</Link> para rever mercado, localização, recursos, formalização e execução.</p>
|
||||
<p>
|
||||
<Link href="/como-investir" className="underline">
|
||||
Voltar ao roteiro de investimento
|
||||
</Link>{' '}
|
||||
para rever mercado, localização, recursos, formalização e
|
||||
execução.
|
||||
</p>
|
||||
<SimulationForm />
|
||||
</div>
|
||||
);
|
||||
@@ -455,13 +472,41 @@ export default function Services(p: Props) {
|
||||
});
|
||||
const [selectedPartner, setSelectedPartner] = useState<number>();
|
||||
const title = p.sector?.name ?? titles[p.section];
|
||||
const formTypes = ['official_form', 'digital_adaptation', 'guidance_template'];
|
||||
const firstFormIndex = p.resources?.data.findIndex((resource) => formTypes.includes(resource.document_type)) ?? -1;
|
||||
const activeFilterNames: Record<string, string> = { q: 'Texto', topic: 'Assunto', category: 'Categoria', document_type: 'Tipo', activity: 'Actividade', stage: 'Etapa', module: 'Módulo', issuer: 'Emitente', language: 'Idioma', legal_status: 'Situação', source_confirmation: 'Fonte', territory_id: 'Território' };
|
||||
const activeFilters = Object.entries(filter.data).flatMap(([key, value]) => {
|
||||
const text = Array.isArray(value) ? value.join(', ') : typeof value === 'string' ? value : '';
|
||||
return activeFilterNames[key] && text.trim() ? [`${activeFilterNames[key]}: ${text}`] : [];
|
||||
});
|
||||
const formTypes = [
|
||||
'official_form',
|
||||
'digital_adaptation',
|
||||
'guidance_template',
|
||||
];
|
||||
const firstFormIndex =
|
||||
p.resources?.data.findIndex((resource) =>
|
||||
formTypes.includes(resource.document_type),
|
||||
) ?? -1;
|
||||
const activeFilterNames: Record<string, string> = {
|
||||
q: 'Texto',
|
||||
topic: 'Assunto',
|
||||
category: 'Categoria',
|
||||
document_type: 'Tipo',
|
||||
activity: 'Actividade',
|
||||
stage: 'Etapa',
|
||||
module: 'Módulo',
|
||||
issuer: 'Emitente',
|
||||
language: 'Idioma',
|
||||
legal_status: 'Situação',
|
||||
source_confirmation: 'Fonte',
|
||||
territory_id: 'Território',
|
||||
};
|
||||
const activeFilters = Object.entries(filter.data).flatMap(
|
||||
([key, value]) => {
|
||||
const text = Array.isArray(value)
|
||||
? value.join(', ')
|
||||
: typeof value === 'string'
|
||||
? value
|
||||
: '';
|
||||
return activeFilterNames[key] && text.trim()
|
||||
? [`${activeFilterNames[key]}: ${text}`]
|
||||
: [];
|
||||
},
|
||||
);
|
||||
return (
|
||||
<div className="min-h-screen bg-slate-50 text-slate-900">
|
||||
<Head title={title} />
|
||||
@@ -629,24 +674,124 @@ export default function Services(p: Props) {
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
{!!p.activities?.length && <fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">Actividade ou CAE</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.activities.map((activity) => <label key={activity} className="flex items-start gap-2 break-words"><input type="checkbox" checked={filter.data.activity.includes(activity)} onChange={(e) => filter.setData('activity', e.target.checked ? [...filter.data.activity, activity] : filter.data.activity.filter((value) => value !== activity))} /><span>{activity}</span></label>)}
|
||||
</div>
|
||||
</fieldset>}
|
||||
{!!p.stages?.length && <fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">Etapa do projecto</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.stages.map((stage) => <label key={stage} className="flex items-start gap-2 break-words"><input type="checkbox" checked={filter.data.stage.includes(stage)} onChange={(e) => filter.setData('stage', e.target.checked ? [...filter.data.stage, stage] : filter.data.stage.filter((value) => value !== stage))} /><span>{stage}</span></label>)}
|
||||
</div>
|
||||
</fieldset>}
|
||||
{!!p.modules?.length && <fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">Módulo</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.modules.map((module) => <label key={module} className="flex items-start gap-2 break-words"><input type="checkbox" checked={filter.data.module.includes(module)} onChange={(e) => filter.setData('module', e.target.checked ? [...filter.data.module, module] : filter.data.module.filter((value) => value !== module))} /><span>{module}</span></label>)}
|
||||
</div>
|
||||
</fieldset>}
|
||||
{!!p.activities?.length && (
|
||||
<fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">
|
||||
Actividade ou CAE
|
||||
</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.activities.map((activity) => (
|
||||
<label
|
||||
key={activity}
|
||||
className="flex items-start gap-2 break-words"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={filter.data.activity.includes(
|
||||
activity,
|
||||
)}
|
||||
onChange={(e) =>
|
||||
filter.setData(
|
||||
'activity',
|
||||
e.target.checked
|
||||
? [
|
||||
...filter
|
||||
.data
|
||||
.activity,
|
||||
activity,
|
||||
]
|
||||
: filter.data.activity.filter(
|
||||
(value) =>
|
||||
value !==
|
||||
activity,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<span>{activity}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
)}
|
||||
{!!p.stages?.length && (
|
||||
<fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">
|
||||
Etapa do projecto
|
||||
</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.stages.map((stage) => (
|
||||
<label
|
||||
key={stage}
|
||||
className="flex items-start gap-2 break-words"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={filter.data.stage.includes(
|
||||
stage,
|
||||
)}
|
||||
onChange={(e) =>
|
||||
filter.setData(
|
||||
'stage',
|
||||
e.target.checked
|
||||
? [
|
||||
...filter
|
||||
.data
|
||||
.stage,
|
||||
stage,
|
||||
]
|
||||
: filter.data.stage.filter(
|
||||
(value) =>
|
||||
value !==
|
||||
stage,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<span>{stage}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
)}
|
||||
{!!p.modules?.length && (
|
||||
<fieldset className="min-w-0 rounded border p-3">
|
||||
<legend className="px-1">Módulo</legend>
|
||||
<div className="max-h-36 space-y-2 overflow-y-auto">
|
||||
{p.modules.map((module) => (
|
||||
<label
|
||||
key={module}
|
||||
className="flex items-start gap-2 break-words"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={filter.data.module.includes(
|
||||
module,
|
||||
)}
|
||||
onChange={(e) =>
|
||||
filter.setData(
|
||||
'module',
|
||||
e.target.checked
|
||||
? [
|
||||
...filter
|
||||
.data
|
||||
.module,
|
||||
module,
|
||||
]
|
||||
: filter.data.module.filter(
|
||||
(value) =>
|
||||
value !==
|
||||
module,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<span>{module}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
)}
|
||||
<label className="block min-w-0">
|
||||
Entidade emitente
|
||||
<select
|
||||
@@ -763,188 +908,281 @@ export default function Services(p: Props) {
|
||||
Limpar filtros
|
||||
</Link>
|
||||
</form>
|
||||
{activeFilters.length > 0 && <section aria-label="Filtros activos" className="rounded border bg-white p-3">
|
||||
<h2 className="font-semibold">Filtros activos</h2>
|
||||
<ul className="flex flex-wrap gap-2">{activeFilters.map((item) => <li key={item} className="rounded-full bg-slate-100 px-3 py-1 text-sm">{item}</li>)}</ul>
|
||||
</section>}
|
||||
<p role="status" aria-live="polite">{p.resources?.total ?? 0} documentos correspondem aos filtros activos.</p>
|
||||
{!!p.topics?.length && <nav aria-label="Navegar por assunto" className="flex flex-wrap gap-2">
|
||||
<span className="font-semibold">Assuntos:</span>
|
||||
{p.topics.map((topic) => <Link key={topic} className="rounded-full border bg-white px-3 py-1 underline" href={`${p.section === 'documents' ? '/documentos' : '/legislacao'}?${new URLSearchParams({ topic }).toString()}`}>{topic}</Link>)}
|
||||
</nav>}
|
||||
<p className="text-sm">Os documentos nacionais aplicáveis continuam incluídos numa pesquisa territorial e são identificados como nacionais. A localização da entidade emitente não define o âmbito de aplicação.</p>
|
||||
{p.resources?.data.map((r, index) => (
|
||||
<div key={r.id} className="contents">{index === 0 && <h2 className="pt-4 text-xl font-bold">{firstFormIndex === 0 ? 'Formulários e modelos' : 'Documentos de consulta'}</h2>}{index === firstFormIndex && firstFormIndex > 0 && <h2 className="pt-4 text-xl font-bold">Formulários e modelos</h2>}
|
||||
<article
|
||||
key={r.id}
|
||||
className="min-w-0 space-y-2 overflow-hidden rounded-xl border bg-white p-5"
|
||||
{activeFilters.length > 0 && (
|
||||
<section
|
||||
aria-label="Filtros activos"
|
||||
className="rounded border bg-white p-3"
|
||||
>
|
||||
<h2 className="text-xl font-bold break-words">
|
||||
{r.title}
|
||||
{r.essential ? ' · Essencial' : ''}
|
||||
<h2 className="font-semibold">
|
||||
Filtros activos
|
||||
</h2>
|
||||
<p>
|
||||
{documentTypeLabels[r.document_type] ?? r.document_type} · {r.category} · {r.topic}
|
||||
</p>
|
||||
{r.description && <p>{r.description}</p>}
|
||||
<dl className="grid gap-2 text-sm sm:grid-cols-2">
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Entidade emitente
|
||||
</dt>
|
||||
<dd>{r.issuer ?? 'Não indicada'}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Número e data
|
||||
</dt>
|
||||
<dd>
|
||||
{[
|
||||
r.document_number,
|
||||
r.document_date,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' · ') || 'Não indicados'}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Versão / idioma
|
||||
</dt>
|
||||
<dd>
|
||||
{r.version_label ??
|
||||
'Versão não indicada'}{' '}
|
||||
· {r.language}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">Período de aplicação documentado</dt>
|
||||
<dd>{r.applicable_from || r.applicable_until ? `${r.applicable_from ?? 'Início não indicado'} — ${r.applicable_until ?? 'Sem data final indicada'}` : 'Não registado'}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Âmbito
|
||||
</dt>
|
||||
<dd>
|
||||
{r.territorial_scope === 'national'
|
||||
? 'Nacional'
|
||||
: r.territorial_scope ===
|
||||
'unknown'
|
||||
? 'Por confirmar'
|
||||
: r.territorial_scope}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">Fonte</dt>
|
||||
<dd>
|
||||
{r.source_confirmation ===
|
||||
'official_confirmed'
|
||||
? 'Fonte oficial confirmada'
|
||||
: r.source_confirmation ===
|
||||
'identified'
|
||||
? 'Origem identificada'
|
||||
: 'Fonte por confirmar'}
|
||||
</dd>
|
||||
</div>
|
||||
{r.source_confirmation === 'identified' && (
|
||||
<div className="sm:col-span-2 rounded border border-amber-300 bg-amber-50 p-3" role="note">
|
||||
A origem está identificada, mas a autenticidade desta cópia não foi confirmada independentemente. Consulte a fonte indicada.
|
||||
<ul className="flex flex-wrap gap-2">
|
||||
{activeFilters.map((item) => (
|
||||
<li
|
||||
key={item}
|
||||
className="rounded-full bg-slate-100 px-3 py-1 text-sm"
|
||||
>
|
||||
{item}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)}
|
||||
<p role="status" aria-live="polite">
|
||||
{p.resources?.total ?? 0} documentos correspondem
|
||||
aos filtros activos.
|
||||
</p>
|
||||
{!!p.topics?.length && (
|
||||
<nav
|
||||
aria-label="Navegar por assunto"
|
||||
className="flex flex-wrap gap-2"
|
||||
>
|
||||
<span className="font-semibold">Assuntos:</span>
|
||||
{p.topics.map((topic) => (
|
||||
<Link
|
||||
key={topic}
|
||||
className="rounded-full border bg-white px-3 py-1 underline"
|
||||
href={`${p.section === 'documents' ? '/documentos' : '/legislacao'}?${new URLSearchParams({ topic }).toString()}`}
|
||||
>
|
||||
{topic}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
<p className="text-sm">
|
||||
Os documentos nacionais aplicáveis continuam
|
||||
incluídos numa pesquisa territorial e são
|
||||
identificados como nacionais. A localização da
|
||||
entidade emitente não define o âmbito de aplicação.
|
||||
</p>
|
||||
{p.resources?.data.map((r, index) => (
|
||||
<div key={r.id} className="contents">
|
||||
{index === 0 && (
|
||||
<h2 className="pt-4 text-xl font-bold">
|
||||
{firstFormIndex === 0
|
||||
? 'Formulários e modelos'
|
||||
: 'Documentos de consulta'}
|
||||
</h2>
|
||||
)}
|
||||
{index === firstFormIndex &&
|
||||
firstFormIndex > 0 && (
|
||||
<h2 className="pt-4 text-xl font-bold">
|
||||
Formulários e modelos
|
||||
</h2>
|
||||
)}
|
||||
<article
|
||||
key={r.id}
|
||||
className="min-w-0 space-y-2 overflow-hidden rounded-xl border bg-white p-5"
|
||||
>
|
||||
<h2 className="text-xl font-bold break-words">
|
||||
{r.title}
|
||||
{r.essential ? ' · Essencial' : ''}
|
||||
</h2>
|
||||
<p>
|
||||
{documentTypeLabels[r.document_type] ??
|
||||
r.document_type}{' '}
|
||||
· {r.category} · {r.topic}
|
||||
</p>
|
||||
{r.description && <p>{r.description}</p>}
|
||||
<dl className="grid gap-2 text-sm sm:grid-cols-2">
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Entidade emitente
|
||||
</dt>
|
||||
<dd>
|
||||
{r.issuer ?? 'Não indicada'}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Número e data
|
||||
</dt>
|
||||
<dd>
|
||||
{[
|
||||
r.document_number,
|
||||
r.document_date,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' · ') ||
|
||||
'Não indicados'}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Versão / idioma
|
||||
</dt>
|
||||
<dd>
|
||||
{r.version_label ??
|
||||
'Versão não indicada'}{' '}
|
||||
· {r.language}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Período de aplicação documentado
|
||||
</dt>
|
||||
<dd>
|
||||
{r.applicable_from ||
|
||||
r.applicable_until
|
||||
? `${r.applicable_from ?? 'Início não indicado'} — ${r.applicable_until ?? 'Sem data final indicada'}`
|
||||
: 'Não registado'}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Âmbito
|
||||
</dt>
|
||||
<dd>
|
||||
{r.territorial_scope ===
|
||||
'national'
|
||||
? 'Nacional'
|
||||
: r.territorial_scope ===
|
||||
'unknown'
|
||||
? 'Por confirmar'
|
||||
: r.territorial_scope}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Fonte
|
||||
</dt>
|
||||
<dd>
|
||||
{r.source_confirmation ===
|
||||
'official_confirmed'
|
||||
? 'Fonte oficial confirmada'
|
||||
: r.source_confirmation ===
|
||||
'identified'
|
||||
? 'Origem identificada'
|
||||
: 'Fonte por confirmar'}
|
||||
</dd>
|
||||
</div>
|
||||
{r.source_confirmation ===
|
||||
'identified' && (
|
||||
<div
|
||||
className="rounded border border-amber-300 bg-amber-50 p-3 sm:col-span-2"
|
||||
role="note"
|
||||
>
|
||||
A origem está identificada, mas
|
||||
a autenticidade desta cópia não
|
||||
foi confirmada
|
||||
independentemente. Consulte a
|
||||
fonte indicada.
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Vigência
|
||||
</dt>
|
||||
<dd>
|
||||
{legalStatusLabels[
|
||||
r.legal_status
|
||||
] ?? r.legal_status}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Revisão
|
||||
</dt>
|
||||
<dd>
|
||||
Revisão administrativa registada{' '}
|
||||
{r.independent_review
|
||||
? 'com revisão independente'
|
||||
: 'sem revisão independente'}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p className="my-3 text-sm">
|
||||
Fonte: {r.source_reference}
|
||||
</p>
|
||||
<Link
|
||||
className="mr-4 inline-block underline"
|
||||
href={`/documentos/${r.id}?${new URLSearchParams({ back: currentUrl }).toString()}`}
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{r.view_url && (
|
||||
<a
|
||||
className="mr-4 inline-block underline"
|
||||
href={r.view_url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Consultar ficheiro
|
||||
</a>
|
||||
)}
|
||||
{r.links?.length > 0 && (
|
||||
<div className="text-sm">
|
||||
<strong>
|
||||
Onde este documento é utilizado:
|
||||
</strong>
|
||||
<ul className="list-disc pl-6">
|
||||
{r.links.map((link, index) => (
|
||||
<li
|
||||
key={`${link.target_type}-${link.target_key}-${index}`}
|
||||
>
|
||||
{link.target_type ===
|
||||
'module' &&
|
||||
publicModulePaths[
|
||||
link.target_key
|
||||
] ? (
|
||||
<Link
|
||||
className="underline"
|
||||
href={
|
||||
publicModulePaths[
|
||||
link
|
||||
.target_key
|
||||
].href
|
||||
}
|
||||
>
|
||||
{
|
||||
publicModulePaths[
|
||||
link
|
||||
.target_key
|
||||
].label
|
||||
}
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
{link.target_type ===
|
||||
'requirement'
|
||||
? `Requisito documental: ${link.target_label ?? link.target_key}`
|
||||
: `${link.target_type}: ${link.target_key}`}
|
||||
</>
|
||||
)}{' '}
|
||||
· {link.relationship} ·{' '}
|
||||
{link.applicability}
|
||||
{link.condition_text
|
||||
? ` · Condição: ${link.condition_text}`
|
||||
: ''}
|
||||
{link.basis_reference
|
||||
? ` · Referência documental: ${link.basis_reference}`
|
||||
: ''}
|
||||
{link.review_status ===
|
||||
'confirmed'
|
||||
? ' · Citação conferida; aplicação fiscal pendente'
|
||||
: ' · Pendente de conferência; não é fundamento confirmado'}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Vigência
|
||||
</dt>
|
||||
<dd>
|
||||
{legalStatusLabels[r.legal_status] ?? r.legal_status}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Revisão
|
||||
</dt>
|
||||
<dd>
|
||||
Revisão administrativa registada{' '}
|
||||
{r.independent_review
|
||||
? 'com revisão independente'
|
||||
: 'sem revisão independente'}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p className="my-3 text-sm">
|
||||
Fonte: {r.source_reference}
|
||||
</p>
|
||||
<Link className="mr-4 inline-block underline" href={`/documentos/${r.id}?${new URLSearchParams({ back: currentUrl }).toString()}`}>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{r.view_url && <a className="mr-4 inline-block underline" href={r.view_url} target="_blank" rel="noreferrer">Consultar ficheiro</a>}
|
||||
{r.links?.length > 0 && (
|
||||
<div className="text-sm">
|
||||
<strong>
|
||||
Onde este documento é utilizado:
|
||||
</strong>
|
||||
<ul className="list-disc pl-6">
|
||||
{r.links.map((link, index) => (
|
||||
<li
|
||||
key={`${link.target_type}-${link.target_key}-${index}`}
|
||||
>
|
||||
{link.target_type ===
|
||||
'module' &&
|
||||
publicModulePaths[
|
||||
link.target_key
|
||||
] ? (
|
||||
<Link
|
||||
className="underline"
|
||||
href={
|
||||
publicModulePaths[
|
||||
link.target_key
|
||||
].href
|
||||
}
|
||||
>
|
||||
{
|
||||
publicModulePaths[
|
||||
link.target_key
|
||||
].label
|
||||
}
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
{link.target_type === 'requirement' ? `Requisito documental: ${link.target_label ?? link.target_key}` : `${link.target_type}: ${link.target_key}`}
|
||||
</>
|
||||
)}{' '}
|
||||
· {link.relationship} ·{' '}
|
||||
{link.applicability}
|
||||
{link.condition_text
|
||||
? ` · Condição: ${link.condition_text}`
|
||||
: ''}
|
||||
{link.basis_reference
|
||||
? ` · Referência documental: ${link.basis_reference}`
|
||||
: ''}
|
||||
{link.review_status === 'confirmed'
|
||||
? ' · Citação conferida; aplicação fiscal pendente'
|
||||
: ' · Pendente de conferência; não é fundamento confirmado'}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
{r.source_url && (
|
||||
{r.source_url && (
|
||||
<a
|
||||
className="underline"
|
||||
href={r.source_url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Abrir fonte identificada
|
||||
</a>
|
||||
)}
|
||||
<a
|
||||
className="underline"
|
||||
href={r.source_url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href={r.download_url}
|
||||
className="ml-4 underline"
|
||||
>
|
||||
Abrir fonte identificada
|
||||
Descarregar {r.title}
|
||||
</a>
|
||||
)}
|
||||
<a
|
||||
href={r.download_url}
|
||||
className="ml-4 underline"
|
||||
>
|
||||
Descarregar {r.title}
|
||||
</a>
|
||||
</article>
|
||||
</article>
|
||||
</div>
|
||||
))}
|
||||
{!p.resources?.data.length && (
|
||||
|
||||
Reference in New Issue
Block a user