1442 lines
69 KiB
TypeScript
1442 lines
69 KiB
TypeScript
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
|
import { useState } from 'react';
|
|
import { PortalMenu } from '@/layouts/portal-navigation';
|
|
import { newSubmissionKey } from '@/lib/portal-api';
|
|
import { ProvinceSelect } from '@/components/investment-territory';
|
|
import { SimulationForm } from '@/components/simulation-form';
|
|
|
|
const input =
|
|
'box-border w-full min-w-0 max-w-full rounded-lg border border-slate-300 bg-white p-3 text-slate-900';
|
|
const button =
|
|
'inline-block rounded-lg bg-emerald-800 px-5 py-3 font-semibold text-white disabled:opacity-50';
|
|
const titles: Record<string, string> = {
|
|
sectors: 'Sectores Prioritários',
|
|
sector: 'Sector prioritário',
|
|
procedures: 'Como Investir / Procedimentos',
|
|
legislation: 'Legislação e Incentivos',
|
|
documents: 'Documentos e Formulários',
|
|
support: 'Apoio ao Investidor',
|
|
partnerships: 'Bolsa de Parcerias',
|
|
simulator: 'Simulador Fiscal',
|
|
investor: 'Formulário de investidor',
|
|
company: 'Formulário de empresa',
|
|
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',
|
|
};
|
|
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',
|
|
};
|
|
type Resource = {
|
|
id: number;
|
|
document_id: string;
|
|
title: string;
|
|
description: string | null;
|
|
category: string;
|
|
topic: string;
|
|
document_type: string;
|
|
document_number: string | null;
|
|
document_date: string | null;
|
|
applicable_from: string | null;
|
|
applicable_until: string | null;
|
|
source_url: string | null;
|
|
language: string;
|
|
version_label: string | null;
|
|
territorial_scope: string;
|
|
source_confirmation: string;
|
|
legal_status: string;
|
|
rights_status: string;
|
|
last_reviewed_at: string | null;
|
|
independent_review: boolean;
|
|
issuer: string | null;
|
|
source_reference: string;
|
|
essential: boolean;
|
|
links: {
|
|
target_type: string;
|
|
target_key: string;
|
|
relationship: string;
|
|
applicability: string;
|
|
condition_text: string | null;
|
|
basis_reference: string | null;
|
|
review_status: string;
|
|
}[];
|
|
download_url: string;
|
|
view_url: string | null;
|
|
};
|
|
type Partnership = {
|
|
id: number;
|
|
title: string;
|
|
sector: string;
|
|
province: string;
|
|
offer: string;
|
|
seeking: string;
|
|
};
|
|
type Page<T> = {
|
|
data: T[];
|
|
prev_page_url: string | null;
|
|
next_page_url: string | null;
|
|
total: number;
|
|
};
|
|
type Props = {
|
|
section: string;
|
|
filters?: Record<string, string | string[]>;
|
|
sectors?: {
|
|
name: string;
|
|
slug: string;
|
|
short_description: string;
|
|
opportunities_count: number;
|
|
}[];
|
|
sector?: {
|
|
name: string;
|
|
slug: string;
|
|
description: string;
|
|
short_description: string;
|
|
};
|
|
opportunities?: {
|
|
title: string;
|
|
slug: string;
|
|
province: string;
|
|
summary: string;
|
|
}[];
|
|
resources?: Page<Resource>;
|
|
categories?: string[];
|
|
topics?: string[];
|
|
documentTypes?: string[];
|
|
languages?: string[];
|
|
issuers?: string[];
|
|
legalStatuses?: string[];
|
|
territories?: {
|
|
id: string;
|
|
name: string;
|
|
location_type: string;
|
|
parent_id: string | null;
|
|
}[];
|
|
activities?: string[];
|
|
stages?: string[];
|
|
modules?: string[];
|
|
partnerships?: Page<Partnership>;
|
|
contacts?: {
|
|
email?: string;
|
|
phone?: string;
|
|
address?: string;
|
|
hours?: string;
|
|
};
|
|
requests?: {
|
|
reference: string;
|
|
status: string;
|
|
created_at: string;
|
|
metadata: { kind: string };
|
|
}[];
|
|
myPartnerships?: { id: number; title: string; status: string }[];
|
|
};
|
|
const states: Record<string, string> = {
|
|
received: 'Recebido',
|
|
in_review: 'Em análise',
|
|
contacted: 'Contactado',
|
|
closed: 'Encerrado',
|
|
pending: 'A aguardar publicação',
|
|
published: 'Publicado',
|
|
withdrawn: 'Retirado',
|
|
};
|
|
const publicModulePaths: Record<string, { label: string; href: string }> = {
|
|
simulator: { label: 'Simulador fiscal', href: '/Simulador' },
|
|
procedures: { label: 'Procedimentos', href: '/como-investir' },
|
|
legislation: { label: 'Legislação e incentivos', href: '/legislacao' },
|
|
};
|
|
|
|
function Pagination({ page }: { page: Page<unknown> }) {
|
|
return (
|
|
<nav aria-label="Paginação" className="flex gap-6 py-5">
|
|
{page.prev_page_url && (
|
|
<Link href={page.prev_page_url}>Anterior</Link>
|
|
)}
|
|
<span>{page.total} registos</span>
|
|
{page.next_page_url && (
|
|
<Link href={page.next_page_url}>Seguinte</Link>
|
|
)}
|
|
</nav>
|
|
);
|
|
}
|
|
|
|
function RequestForm({
|
|
kind,
|
|
partnershipId,
|
|
}: {
|
|
kind: string;
|
|
partnershipId?: number;
|
|
}) {
|
|
const { auth } = usePage<{
|
|
auth: { user: { name: string; email: string } | null };
|
|
}>().props;
|
|
const form = useForm({
|
|
kind,
|
|
fullName: auth.user?.name ?? '',
|
|
email: auth.user?.email ?? '',
|
|
phone: '',
|
|
country: 'Moçambique',
|
|
company: '',
|
|
sectorInterest: '',
|
|
message: '',
|
|
privacyConsent: false,
|
|
submission_key: '',
|
|
partnership_id: partnershipId ?? null,
|
|
});
|
|
const [sent, setSent] = useState(false);
|
|
return (
|
|
<form
|
|
className="space-y-4 rounded-xl border bg-white p-6"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
const key = form.data.submission_key || newSubmissionKey();
|
|
form.setData('submission_key', key);
|
|
form.transform((data) => ({ ...data, submission_key: key }));
|
|
form.post('/apoio', {
|
|
preserveScroll: true,
|
|
onSuccess: () => setSent(true),
|
|
});
|
|
}}
|
|
>
|
|
<h2 className="text-xl font-bold">
|
|
{kind === 'company'
|
|
? 'Dados da empresa e do representante'
|
|
: 'Enviar pedido'}
|
|
</h2>
|
|
{!auth.user && (
|
|
<p className="text-sm">
|
|
Pode enviar sem conta. Para acompanhar no Balcão Virtual,{' '}
|
|
<Link href="/login" className="underline">
|
|
entre antes de enviar
|
|
</Link>
|
|
.
|
|
</p>
|
|
)}
|
|
{(
|
|
[
|
|
'fullName',
|
|
'email',
|
|
'phone',
|
|
'country',
|
|
'sectorInterest',
|
|
...(kind === 'company' ? ['company'] : []),
|
|
] as const
|
|
).map((key) => {
|
|
const field = key as
|
|
| 'fullName'
|
|
| 'email'
|
|
| 'phone'
|
|
| 'country'
|
|
| 'sectorInterest'
|
|
| 'company';
|
|
const labels = {
|
|
fullName: 'Nome do representante',
|
|
email: 'Email',
|
|
phone: 'Telefone (opcional)',
|
|
country: 'País',
|
|
sectorInterest: 'Sector ou assunto',
|
|
company: 'Nome da empresa',
|
|
};
|
|
return (
|
|
<label key={field} className="block space-y-1">
|
|
<span>{labels[field]}</span>
|
|
<input
|
|
className={input}
|
|
type={field === 'email' ? 'email' : 'text'}
|
|
required={field !== 'phone'}
|
|
maxLength={field === 'phone' ? 30 : 150}
|
|
value={form.data[field]}
|
|
onChange={(e) =>
|
|
form.setData(field, e.target.value)
|
|
}
|
|
/>
|
|
</label>
|
|
);
|
|
})}
|
|
<label className="block">
|
|
Descreva o pedido
|
|
<textarea
|
|
className={input}
|
|
required
|
|
minLength={20}
|
|
maxLength={2000}
|
|
rows={5}
|
|
value={form.data.message}
|
|
onChange={(e) => form.setData('message', e.target.value)}
|
|
/>
|
|
</label>
|
|
<label className="flex items-start gap-3">
|
|
<input
|
|
type="checkbox"
|
|
required
|
|
checked={form.data.privacyConsent}
|
|
onChange={(e) =>
|
|
form.setData('privacyConsent', e.target.checked)
|
|
}
|
|
/>
|
|
<span>
|
|
Autorizo o tratamento destes dados para responder e
|
|
acompanhar este pedido. Os dados ficam acessíveis à equipa
|
|
de atendimento; não serão publicados na bolsa.
|
|
</span>
|
|
</label>
|
|
{Object.entries(form.errors).map(([key, error]) => (
|
|
<p key={key} role="alert" className="text-red-700">
|
|
{error}
|
|
</p>
|
|
))}
|
|
{sent ? (
|
|
<p role="status">
|
|
Pedido enviado. Guarde o protocolo apresentado acima.{' '}
|
|
<button
|
|
type="button"
|
|
className="underline"
|
|
onClick={() => {
|
|
setSent(false);
|
|
form.setData('submission_key', '');
|
|
form.setData('message', '');
|
|
}}
|
|
>
|
|
Enviar novo pedido
|
|
</button>
|
|
</p>
|
|
) : (
|
|
<button className={button} disabled={form.processing}>
|
|
Enviar e obter protocolo
|
|
</button>
|
|
)}
|
|
</form>
|
|
);
|
|
}
|
|
|
|
function PartnershipForm() {
|
|
const form = useForm({
|
|
title: '',
|
|
sector: '',
|
|
province: '',
|
|
offer: '',
|
|
seeking: '',
|
|
publication_consent: false,
|
|
});
|
|
return (
|
|
<form
|
|
className="space-y-4 rounded-xl border p-6"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
form.post('/parcerias', {
|
|
preserveScroll: true,
|
|
onSuccess: () => form.reset(),
|
|
});
|
|
}}
|
|
>
|
|
<h2 className="text-xl font-bold">Propor parceria</h2>
|
|
<p>
|
|
Descreva apenas informação destinada a publicação. Não inclua
|
|
contactos pessoais ou documentos confidenciais.
|
|
</p>
|
|
{(['title', 'sector', 'province', 'offer', 'seeking'] as const).map(
|
|
(key) => (
|
|
<label className="block" key={key}>
|
|
{
|
|
{
|
|
title: 'Título',
|
|
sector: 'Sector',
|
|
province: 'Província',
|
|
offer: 'O que oferece',
|
|
seeking: 'Parceiro ou capacidade que procura',
|
|
}[key]
|
|
}
|
|
{key === 'province' ? (
|
|
<ProvinceSelect
|
|
value={form.data.province}
|
|
onChange={(province) =>
|
|
form.setData('province', province)
|
|
}
|
|
className={input}
|
|
required
|
|
placeholder="Seleccione uma província"
|
|
label="Província"
|
|
/>
|
|
) : (
|
|
<textarea
|
|
className={input}
|
|
required
|
|
minLength={
|
|
key === 'offer' || key === 'seeking'
|
|
? 20
|
|
: 1
|
|
}
|
|
maxLength={
|
|
key === 'offer' || key === 'seeking'
|
|
? 2000
|
|
: 100
|
|
}
|
|
value={form.data[key]}
|
|
onChange={(e) =>
|
|
form.setData(key, e.target.value)
|
|
}
|
|
/>
|
|
)}
|
|
</label>
|
|
),
|
|
)}
|
|
<label className="flex gap-2">
|
|
<input
|
|
type="checkbox"
|
|
required
|
|
checked={form.data.publication_consent}
|
|
onChange={(e) =>
|
|
form.setData('publication_consent', e.target.checked)
|
|
}
|
|
/>
|
|
Autorizo a publicação dos dados desta proposta após revisão.
|
|
</label>
|
|
{Object.entries(form.errors).map(([key, error]) => (
|
|
<p role="alert" key={key}>
|
|
{error}
|
|
</p>
|
|
))}
|
|
<button disabled={form.processing} className={button}>
|
|
Submeter proposta
|
|
</button>
|
|
</form>
|
|
);
|
|
}
|
|
|
|
function Simulator() {
|
|
return <SimulationForm />;
|
|
}
|
|
|
|
type GuideStep = {
|
|
title: string;
|
|
objective: string;
|
|
inputs: string;
|
|
documents: string;
|
|
source: string;
|
|
result: string;
|
|
href: string;
|
|
action: string;
|
|
};
|
|
|
|
function InvestmentGuide() {
|
|
const [path, setPath] = useState<'defined' | 'idea'>('defined');
|
|
const [activity, setActivity] = useState('');
|
|
const [maturity, setMaturity] = useState('A explorar');
|
|
const [locationKnown, setLocationKnown] = useState(false);
|
|
const definedSteps: GuideStep[] = [
|
|
{
|
|
title: 'Organizar o projecto e os pressupostos',
|
|
objective:
|
|
'Consolidar investimento inicial, capitais próprios, financiamento, receitas e custos.',
|
|
inputs: 'Actividade, localização em vista e valores conhecidos.',
|
|
documents:
|
|
'Plano, orçamento ou cotações se já existirem; não são exigidos para explorar.',
|
|
source: 'Dados declarados pelo promotor; identifique a origem e data das hipóteses de mercado.',
|
|
result: 'Dossier inicial com dados conhecidos e lacunas visíveis.',
|
|
href: '/Simulador',
|
|
action: 'Abrir o dossier e plano financeiro',
|
|
},
|
|
{
|
|
title: 'Simular o efeito fiscal',
|
|
objective:
|
|
'Estimar impostos conforme actividade, localização, período e características da operação. A simulação fiscal não determina rentabilidade.',
|
|
inputs: 'Período, actividade, localização e operações fiscais relevantes.',
|
|
documents:
|
|
'Comprovativos só quando necessários para sustentar deduções ou condições; não são necessários nesta exploração.',
|
|
source: 'Parâmetros aprovados e fontes legais vigentes. Sem parâmetro necessário, o cálculo fica indisponível.',
|
|
result: 'Resultado estimado, explicação, taxa e fonte quando os dados são suficientes.',
|
|
href: '/simulador-fiscal',
|
|
action: 'Consultar a simulação fiscal',
|
|
},
|
|
{
|
|
title: 'Comparar retorno e cenários',
|
|
objective:
|
|
'Estimar fluxos de caixa, retorno, prazo de recuperação, VAL e TIR se houver dados suficientes; comparar localização e financiamento.',
|
|
inputs: 'Receitas, custos, investimento, calendário e pressupostos de financiamento.',
|
|
documents:
|
|
'Orçamentos e propostas de financiamento, quando existirem.',
|
|
source: 'Pressupostos do dossier e produtos documentados. Incentivos são potenciais e sujeitos a condições.',
|
|
result: 'Cenários financeiros separados do efeito fiscal; imposto reduzido não garante rentabilidade.',
|
|
href: '/Simulador',
|
|
action: 'Comparar cenários financeiros',
|
|
},
|
|
{
|
|
title: 'Confirmar localização e procedimentos',
|
|
objective:
|
|
'Avaliar acesso a clientes, matérias-primas, água, energia, transporte, trabalhadores, instalações, custos e requisitos.',
|
|
inputs: `Actividade: ${activity || 'não indicada'}. Localização conhecida: ${locationKnown ? 'sim, por confirmar' : 'a escolher'}.`,
|
|
documents:
|
|
'Actos, licenças e documentos apenas conforme a actividade e a entidade competente.',
|
|
source: 'Fichas territoriais documentadas e legislação publicada. Zona ou proximidade não confirma serviços, infra-estrutura ou incentivo.',
|
|
result: 'Alternativas e questões a confirmar.',
|
|
href: '/zonas',
|
|
action: 'Explorar zonas e estruturas',
|
|
},
|
|
{
|
|
title: 'Planear a execução',
|
|
objective:
|
|
'Registar equipa, competências, lacunas, custos, prazos e marcos planeados versus realizados.',
|
|
inputs: `Maturidade indicada: ${maturity}.`,
|
|
documents:
|
|
'Documentos de candidatura apenas quando o produto ou procedimento os exigir.',
|
|
source: 'Plano do promotor; critérios de financiamento devem ser verificados junto da entidade.',
|
|
result: 'Próximos passos privados, sem publicação automática nem promessa de aprovação.',
|
|
href: '/investidor/manifestacoes',
|
|
action: 'Aceder ao espaço privado',
|
|
},
|
|
];
|
|
const ideaSteps: GuideStep[] = [
|
|
{
|
|
title: 'Ideia e problema',
|
|
objective:
|
|
'Explicar o que pretende oferecer, a quem e que problema resolve.',
|
|
inputs: `Actividade opcional: ${activity || 'por definir'}.`,
|
|
documents: 'Nenhum documento necessário para começar.',
|
|
source: 'Hipóteses declaradas pelo utilizador, ainda não verificadas.',
|
|
result: 'Rascunho inicial que pode ser guardado e revisto.',
|
|
href: '/Simulador',
|
|
action: 'Começar o projecto',
|
|
},
|
|
{
|
|
title: 'Clientes e mercado',
|
|
objective:
|
|
'Identificar clientes, procura, concorrência, preço e canais.',
|
|
inputs: 'Observações, entrevistas, vendas ou dados encontrados.',
|
|
documents:
|
|
'Registe referências e datas se as tiver; não bloqueiam a exploração.',
|
|
source: 'Distinguir fontes documentadas de informação declarada e estimada.',
|
|
result: 'Hipóteses de mercado e questões por validar.',
|
|
href: '/oportunidades',
|
|
action: 'Explorar oportunidades publicadas',
|
|
},
|
|
{
|
|
title: 'Desenvolver projecto e escolher localização',
|
|
objective:
|
|
'Estimar investimento, receitas, custos, recursos, competências e marcos; comparar clientes, matérias-primas, energia, água, transporte, trabalhadores, instalações, custos e requisitos.',
|
|
inputs: `Localização: ${locationKnown ? 'indicada e por confirmar' : 'pode ser escolhida mais tarde'}; maturidade: ${maturity}.`,
|
|
documents:
|
|
'Cotações e notas de visita se existirem; não são exigidas para continuar.',
|
|
source: 'Fichas e fontes documentadas; proximidade a parque, ZEE, ZFI, cluster ou corredor não garante infra-estrutura nem incentivo.',
|
|
result: 'Plano inicial e alternativas com pressupostos explícitos.',
|
|
href: '/carteira',
|
|
action: 'Explorar localizações e dossiers',
|
|
},
|
|
{
|
|
title: 'Recursos e financiamento',
|
|
objective:
|
|
'Separar capitais próprios de financiamento e registar lacunas de competências e recursos.',
|
|
inputs: 'Montantes, prazos e necessidades conhecidos; não preencher desconhecidos com zero.',
|
|
documents:
|
|
'Documentos apenas quando uma entidade ou produto os exigir.',
|
|
source: 'Produtos e critérios publicados; pré-elegibilidade é indicativa quando disponível.',
|
|
result: 'Necessidades e próximos passos sem promessa de aprovação.',
|
|
href: '/parcerias',
|
|
action: 'Consultar parcerias disponíveis',
|
|
},
|
|
{
|
|
title: 'Formalizar, implementar e acompanhar',
|
|
objective:
|
|
'Confirmar constituição, licenciamento e documentação aplicável; acompanhar marcos planeados e realizados.',
|
|
inputs: `Actividade: ${activity || 'por definir'}; localização pode ficar pendente.`,
|
|
documents:
|
|
'Consultar apenas documentos aplicáveis; empresa constituída não é requisito para explorar a ideia.',
|
|
source: 'Fontes legais e instruções da entidade competente; este guia não recebe pedidos oficiais.',
|
|
result: 'Etapas e lacunas a confirmar antes da execução.',
|
|
href: '/documentos',
|
|
action: 'Consultar documentos e fontes',
|
|
},
|
|
];
|
|
const steps = path === 'defined' ? definedSteps : ideaSteps;
|
|
return (
|
|
<div className="space-y-6">
|
|
<p>
|
|
Escolha o percurso. Pode explorar sem constituir empresa ou
|
|
carregar documentos. O guia ajusta sugestões à actividade,
|
|
maturidade e localização indicadas nesta sessão; estas respostas
|
|
não são enviadas nem guardadas.
|
|
</p>
|
|
<fieldset className="space-y-3 rounded-xl border bg-white p-5">
|
|
<legend className="font-semibold">Ponto de partida</legend>
|
|
<label className="mr-5 inline-flex gap-2">
|
|
<input
|
|
type="radio"
|
|
name="investment-path"
|
|
checked={path === 'defined'}
|
|
onChange={() => setPath('defined')}
|
|
/>
|
|
Tenho um projecto definido
|
|
</label>
|
|
<label className="inline-flex gap-2">
|
|
<input
|
|
type="radio"
|
|
name="investment-path"
|
|
checked={path === 'idea'}
|
|
onChange={() => setPath('idea')}
|
|
/>
|
|
Tenho uma ideia
|
|
</label>
|
|
<label className="mt-3 block">
|
|
Actividade (opcional)
|
|
<input
|
|
className={input}
|
|
value={activity}
|
|
onChange={(event) => setActivity(event.target.value)}
|
|
maxLength={120}
|
|
/>
|
|
</label>
|
|
<label className="mt-3 block">
|
|
Maturidade
|
|
<select
|
|
className={input}
|
|
value={maturity}
|
|
onChange={(event) => setMaturity(event.target.value)}
|
|
>
|
|
<option>A explorar</option>
|
|
<option>A preparar o plano</option>
|
|
<option>Pronto para implementar</option>
|
|
</select>
|
|
</label>
|
|
<label className="mt-3 inline-flex gap-2">
|
|
<input
|
|
type="checkbox"
|
|
checked={locationKnown}
|
|
onChange={(event) =>
|
|
setLocationKnown(event.target.checked)
|
|
}
|
|
/>
|
|
Já tenho uma localização em vista
|
|
</label>
|
|
</fieldset>
|
|
<ol className="space-y-4">
|
|
{steps.map((step, index) => (
|
|
<li
|
|
key={step.title}
|
|
className="space-y-2 rounded-xl border bg-white p-5"
|
|
>
|
|
<h2 className="text-xl font-bold">
|
|
{index + 1}. {step.title}
|
|
</h2>
|
|
<p>
|
|
<strong>Objectivo:</strong> {step.objective}
|
|
</p>
|
|
<p>
|
|
<strong>Informação:</strong> {step.inputs}
|
|
</p>
|
|
<p>
|
|
<strong>Documentos:</strong> {step.documents}
|
|
</p>
|
|
<p>
|
|
<strong>Fonte:</strong> {step.source}
|
|
</p>
|
|
<p>
|
|
<strong>Resultado:</strong> {step.result}
|
|
</p>
|
|
<Link
|
|
href={step.href}
|
|
className="inline-block underline"
|
|
>
|
|
{step.action}
|
|
</Link>
|
|
</li>
|
|
))}
|
|
</ol>
|
|
<p className="rounded border p-4">
|
|
Este é um guia de preparação. Não substitui submissões, licenças
|
|
ou decisões oficiais. Incentivos são potencialmente aplicáveis
|
|
apenas após validação das respectivas condições.
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function Services(p: Props) {
|
|
const { flash, auth } = usePage<{
|
|
flash?: { success?: string };
|
|
auth: { user: unknown };
|
|
}>().props;
|
|
const currentUrl = usePage<{ url: string }>().url;
|
|
const filter = useForm({
|
|
q: typeof p.filters?.q === 'string' ? p.filters.q : '',
|
|
category:
|
|
typeof p.filters?.category === 'string' ? p.filters.category : '',
|
|
topic: typeof p.filters?.topic === 'string' ? p.filters.topic : '',
|
|
sector: typeof p.filters?.sector === 'string' ? p.filters.sector : '',
|
|
province:
|
|
typeof p.filters?.province === 'string' ? p.filters.province : '',
|
|
document_type:
|
|
typeof p.filters?.document_type === 'string'
|
|
? p.filters.document_type
|
|
: '',
|
|
language:
|
|
typeof p.filters?.language === 'string' ? p.filters.language : '',
|
|
issuer: typeof p.filters?.issuer === 'string' ? p.filters.issuer : '',
|
|
legal_status:
|
|
typeof p.filters?.legal_status === 'string'
|
|
? p.filters.legal_status
|
|
: '',
|
|
source_confirmation:
|
|
typeof p.filters?.source_confirmation === 'string'
|
|
? p.filters.source_confirmation
|
|
: '',
|
|
territory_id:
|
|
typeof p.filters?.territory_id === 'string'
|
|
? p.filters.territory_id
|
|
: '',
|
|
activity: Array.isArray(p.filters?.activity) ? p.filters.activity : [],
|
|
stage: Array.isArray(p.filters?.stage) ? p.filters.stage : [],
|
|
module: Array.isArray(p.filters?.module) ? p.filters.module : [],
|
|
});
|
|
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}`] : [];
|
|
});
|
|
return (
|
|
<div className="min-h-screen bg-slate-50 text-slate-900">
|
|
<Head title={title} />
|
|
<PortalMenu />
|
|
<main className="mx-auto max-w-6xl min-w-0 space-y-8 overflow-x-clip px-5 py-10">
|
|
<h1 className="text-3xl font-bold">{title}</h1>
|
|
{flash?.success && (
|
|
<p
|
|
role="status"
|
|
className="rounded border border-emerald-700 bg-emerald-50 p-4"
|
|
>
|
|
{flash.success}
|
|
</p>
|
|
)}
|
|
{p.section === 'sectors' && (
|
|
<div className="grid gap-5 md:grid-cols-3">
|
|
{p.sectors?.map((s) => (
|
|
<article
|
|
className="rounded-xl border bg-white p-6"
|
|
key={s.slug}
|
|
>
|
|
<h2 className="text-xl font-bold">
|
|
<Link href={`/sectores/${s.slug}`}>
|
|
{s.name}
|
|
</Link>
|
|
</h2>
|
|
<p className="my-3">{s.short_description}</p>
|
|
<p>
|
|
{s.opportunities_count} oportunidades
|
|
publicadas
|
|
</p>
|
|
</article>
|
|
))}
|
|
{!p.sectors?.length && (
|
|
<p>Não existem sectores publicados.</p>
|
|
)}
|
|
</div>
|
|
)}
|
|
{p.section === 'sector' && p.sector && (
|
|
<>
|
|
<p className="whitespace-pre-line">
|
|
{p.sector.description ||
|
|
p.sector.short_description ||
|
|
'Descrição sectorial em preparação.'}
|
|
</p>
|
|
<h2 className="text-xl font-bold">
|
|
Oportunidades no sector
|
|
</h2>
|
|
{p.opportunities?.map((o) => (
|
|
<article
|
|
key={o.slug}
|
|
className="rounded border bg-white p-5"
|
|
>
|
|
<Link
|
|
className="text-lg font-bold underline"
|
|
href={`/oportunidades/${o.slug}`}
|
|
>
|
|
{o.title}
|
|
</Link>
|
|
<p>{o.province}</p>
|
|
<p>{o.summary}</p>
|
|
</article>
|
|
))}
|
|
{!p.opportunities?.length && (
|
|
<p>Sem oportunidades publicadas neste sector.</p>
|
|
)}
|
|
<Link
|
|
className={button}
|
|
href={`/oportunidades?sector=${p.sector.slug}`}
|
|
>
|
|
Pesquisar todas as oportunidades do sector
|
|
</Link>
|
|
<p>
|
|
<Link href="/como-investir" className="underline">
|
|
Preparar o investimento
|
|
</Link>{' '}
|
|
·{' '}
|
|
<Link href="/apoio" className="underline">
|
|
Pedir apoio sectorial
|
|
</Link>
|
|
</p>
|
|
</>
|
|
)}
|
|
{p.section === 'procedures' && <InvestmentGuide />}
|
|
{(p.section === 'documents' || p.section === 'legislation') && (
|
|
<>
|
|
<p>
|
|
Biblioteca documental única. A publicação editorial,
|
|
a confirmação da fonte e a vigência jurídica são
|
|
estados distintos.
|
|
</p>
|
|
<form
|
|
className="grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
filter.get(
|
|
p.section === 'documents'
|
|
? '/documentos'
|
|
: '/legislacao',
|
|
);
|
|
}}
|
|
>
|
|
<label className="block min-w-0">
|
|
Pesquisar
|
|
<input
|
|
className={input}
|
|
value={filter.data.q}
|
|
onChange={(e) =>
|
|
filter.setData('q', e.target.value)
|
|
}
|
|
/>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Tema
|
|
<select
|
|
className={input}
|
|
value={filter.data.topic}
|
|
onChange={(e) =>
|
|
filter.setData('topic', e.target.value)
|
|
}
|
|
>
|
|
<option value="">Todos</option>
|
|
{p.topics?.map((topic) => (
|
|
<option key={topic}>{topic}</option>
|
|
))}
|
|
</select>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Categoria
|
|
<select
|
|
className={input}
|
|
value={filter.data.category}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'category',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todas</option>
|
|
{p.categories?.map((category) => (
|
|
<option key={category}>
|
|
{category}
|
|
</option>
|
|
))}
|
|
</select>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Tipo documental
|
|
<select
|
|
className={input}
|
|
value={filter.data.document_type}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'document_type',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todos</option>
|
|
{p.documentTypes?.map((type) => (
|
|
<option key={type} value={type}>
|
|
{type}
|
|
</option>
|
|
))}
|
|
</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>}
|
|
<label className="block min-w-0">
|
|
Entidade emitente
|
|
<select
|
|
className={input}
|
|
value={filter.data.issuer}
|
|
onChange={(e) =>
|
|
filter.setData('issuer', e.target.value)
|
|
}
|
|
>
|
|
<option value="">Todas</option>
|
|
{p.issuers?.map((issuer) => (
|
|
<option key={issuer}>{issuer}</option>
|
|
))}
|
|
</select>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Idioma
|
|
<select
|
|
className={input}
|
|
value={filter.data.language}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'language',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todos</option>
|
|
{p.languages?.map((language) => (
|
|
<option key={language}>
|
|
{language}
|
|
</option>
|
|
))}
|
|
</select>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Situação jurídica indicada
|
|
<select
|
|
className={input}
|
|
value={filter.data.legal_status}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'legal_status',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todas</option>
|
|
{p.legalStatuses?.map((status) => (
|
|
<option key={status}>{status}</option>
|
|
))}
|
|
</select>
|
|
</label>
|
|
<label className="block min-w-0">
|
|
Confirmação da fonte
|
|
<select
|
|
className={input}
|
|
value={filter.data.source_confirmation}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'source_confirmation',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todas</option>
|
|
<option value="official_confirmed">
|
|
Fonte oficial confirmada
|
|
</option>
|
|
<option value="identified">
|
|
Origem identificada
|
|
</option>
|
|
<option value="unconfirmed">
|
|
Por confirmar
|
|
</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Âmbito territorial
|
|
<select
|
|
className={input}
|
|
value={filter.data.territory_id}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
'territory_id',
|
|
e.target.value,
|
|
)
|
|
}
|
|
>
|
|
<option value="">Todos</option>
|
|
{p.territories?.map((territory) => (
|
|
<option
|
|
key={territory.id}
|
|
value={territory.id}
|
|
>
|
|
{territory.name}
|
|
</option>
|
|
))}
|
|
</select>
|
|
<span className="text-xs text-slate-600">
|
|
Documentos nacionais aplicáveis permanecem
|
|
incluídos.
|
|
</span>
|
|
</label>
|
|
<button className={button}>Pesquisar</button>
|
|
<Link
|
|
className="self-center underline"
|
|
href={
|
|
p.section === 'documents'
|
|
? '/documentos'
|
|
: '/legislacao'
|
|
}
|
|
>
|
|
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"
|
|
>
|
|
<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>
|
|
<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}: {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 && (
|
|
<a
|
|
className="underline"
|
|
href={r.source_url}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
>
|
|
Abrir fonte identificada
|
|
</a>
|
|
)}
|
|
<a
|
|
href={r.download_url}
|
|
className="ml-4 underline"
|
|
>
|
|
Descarregar {r.title}
|
|
</a>
|
|
</article>
|
|
</div>
|
|
))}
|
|
{!p.resources?.data.length && (
|
|
<p>
|
|
Não existem documentos publicados para esta
|
|
pesquisa.{' '}
|
|
<Link href="/apoio" className="underline">
|
|
Solicitar documento ao apoio
|
|
</Link>
|
|
.
|
|
</p>
|
|
)}
|
|
{p.resources && <Pagination page={p.resources} />}
|
|
<div className="flex flex-wrap gap-4">
|
|
<Link
|
|
className={button}
|
|
href="/formularios/investidor"
|
|
>
|
|
Formulário de investidor
|
|
</Link>
|
|
<Link
|
|
className={button}
|
|
href="/formularios/empresa"
|
|
>
|
|
Formulário de empresa
|
|
</Link>
|
|
</div>
|
|
</>
|
|
)}
|
|
{['support', 'investor', 'company'].includes(p.section) && (
|
|
<RequestForm
|
|
key={p.section}
|
|
kind={p.section === 'support' ? 'support' : p.section}
|
|
/>
|
|
)}
|
|
{p.section === 'support' && (
|
|
<>
|
|
<section className="space-y-3">
|
|
<h2 className="text-xl font-bold">Contactos</h2>
|
|
{p.contacts?.email && (
|
|
<p>
|
|
Email:{' '}
|
|
<a
|
|
className="underline"
|
|
href={`mailto:${p.contacts.email}`}
|
|
>
|
|
{p.contacts.email}
|
|
</a>
|
|
</p>
|
|
)}
|
|
{p.contacts?.phone && (
|
|
<p>Telefone: {p.contacts.phone}</p>
|
|
)}
|
|
{p.contacts?.address && <p>{p.contacts.address}</p>}
|
|
{p.contacts?.hours && (
|
|
<p>Horário: {p.contacts.hours}</p>
|
|
)}
|
|
{!p.contacts?.email && !p.contacts?.phone && (
|
|
<p>
|
|
Utilize o formulário para contactar a
|
|
equipa. Os contactos directos ainda não
|
|
estão publicados.
|
|
</p>
|
|
)}
|
|
</section>
|
|
<section className="space-y-3">
|
|
<h2 className="text-xl font-bold">
|
|
Perguntas frequentes
|
|
</h2>
|
|
{[
|
|
[
|
|
'Como acompanho um pedido?',
|
|
'Entre antes de enviar o pedido. O protocolo e o estado ficam disponíveis no Balcão Virtual. Para pedidos enviados sem conta, conserve o protocolo e indique-o nos contactos seguintes.',
|
|
],
|
|
[
|
|
'Manifestar interesse garante financiamento ou aprovação?',
|
|
'O envio regista o interesse para análise e contacto da equipa. Não representa aprovação do investimento nem compromisso de financiamento.',
|
|
],
|
|
[
|
|
'Como publico uma parceria?',
|
|
'Entre com email verificado, preencha a proposta na Bolsa de Parcerias e autorize a publicação. A gestão revê a proposta antes de a tornar pública.',
|
|
],
|
|
[
|
|
'Onde obtenho documentos e formulários?',
|
|
'Consulte Documentos e Formulários. Se não encontrar o documento, indique o título ou assunto num pedido de apoio.',
|
|
],
|
|
].map(([q, a]) => (
|
|
<details
|
|
key={q}
|
|
className="rounded border bg-white p-4"
|
|
>
|
|
<summary className="cursor-pointer font-semibold">
|
|
{q}
|
|
</summary>
|
|
<p className="mt-3">{a}</p>
|
|
</details>
|
|
))}
|
|
</section>
|
|
</>
|
|
)}
|
|
{p.section === 'simulator' && <Simulator />}
|
|
{p.section === 'partnerships' && (
|
|
<>
|
|
<p>
|
|
Encontre capacidades e parceiros. O contacto é
|
|
intermediado pelo apoio; os dados privados dos
|
|
proponentes não são publicados.
|
|
</p>
|
|
<form
|
|
className="grid gap-3 md:grid-cols-4"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
filter.get('/parcerias');
|
|
}}
|
|
>
|
|
{(['q', 'sector', 'province'] as const).map(
|
|
(key) => (
|
|
<label key={key}>
|
|
{
|
|
{
|
|
q: 'Pesquisar',
|
|
sector: 'Sector',
|
|
province: 'Província',
|
|
}[key]
|
|
}
|
|
{key === 'province' ? (
|
|
<ProvinceSelect
|
|
value={filter.data.province}
|
|
onChange={(province) =>
|
|
filter.setData(
|
|
'province',
|
|
province,
|
|
)
|
|
}
|
|
className={input}
|
|
placeholder="Todas as províncias"
|
|
label="Filtrar por província"
|
|
/>
|
|
) : (
|
|
<input
|
|
className={input}
|
|
value={filter.data[key]}
|
|
onChange={(e) =>
|
|
filter.setData(
|
|
key,
|
|
e.target.value,
|
|
)
|
|
}
|
|
/>
|
|
)}
|
|
</label>
|
|
),
|
|
)}
|
|
<button className={button}>Filtrar</button>
|
|
</form>
|
|
{p.partnerships?.data.map((item) => (
|
|
<article
|
|
key={item.id}
|
|
className="space-y-3 rounded-xl border bg-white p-6"
|
|
>
|
|
<h2 className="text-xl font-bold">
|
|
{item.title}
|
|
</h2>
|
|
<p>
|
|
{item.sector} · {item.province}
|
|
</p>
|
|
<h3 className="font-bold">Oferece</h3>
|
|
<p className="whitespace-pre-line">
|
|
{item.offer}
|
|
</p>
|
|
<h3 className="font-bold">Procura</h3>
|
|
<p className="whitespace-pre-line">
|
|
{item.seeking}
|
|
</p>
|
|
<button
|
|
className={button}
|
|
onClick={() => setSelectedPartner(item.id)}
|
|
>
|
|
Pedir contacto sobre esta parceria
|
|
</button>
|
|
</article>
|
|
))}
|
|
{!p.partnerships?.data.length && (
|
|
<p>
|
|
Ainda não existem propostas publicadas para esta
|
|
pesquisa.
|
|
</p>
|
|
)}
|
|
{p.partnerships && <Pagination page={p.partnerships} />}
|
|
{selectedPartner && (
|
|
<RequestForm
|
|
key={selectedPartner}
|
|
kind="partnership"
|
|
partnershipId={selectedPartner}
|
|
/>
|
|
)}{' '}
|
|
{auth.user ? (
|
|
<PartnershipForm />
|
|
) : (
|
|
<Link className={button} href="/login">
|
|
Entrar para propor parceria
|
|
</Link>
|
|
)}
|
|
</>
|
|
)}
|
|
{p.section === 'desk' && (
|
|
<>
|
|
<p>
|
|
Acompanhe os pedidos submetidos com esta conta. Os
|
|
contactos da equipa continuam pelos dados fornecidos
|
|
no pedido.
|
|
</p>
|
|
<Link className={button} href="/apoio">
|
|
Novo pedido
|
|
</Link>
|
|
<h2 className="text-xl font-bold">Os meus pedidos</h2>
|
|
{p.requests?.map((r) => (
|
|
<article
|
|
key={r.reference}
|
|
className="rounded border bg-white p-5"
|
|
>
|
|
<strong>{r.reference}</strong>
|
|
<p>{states[r.status] ?? r.status}</p>
|
|
<p>
|
|
{new Date(r.created_at).toLocaleDateString(
|
|
'pt-MZ',
|
|
)}
|
|
</p>
|
|
</article>
|
|
))}
|
|
{!p.requests?.length && (
|
|
<p>
|
|
Ainda não existem pedidos de apoio enviados com
|
|
esta conta.
|
|
</p>
|
|
)}
|
|
<h2 className="text-xl font-bold">
|
|
As minhas propostas de parceria
|
|
</h2>
|
|
{p.myPartnerships?.map((r) => (
|
|
<p key={r.id}>
|
|
{r.title} — {states[r.status] ?? r.status}
|
|
</p>
|
|
))}
|
|
<Link href="/investidor" className="underline">
|
|
Abrir fichas e manifestações de interesse da
|
|
carteira
|
|
</Link>
|
|
</>
|
|
)}
|
|
</main>
|
|
<footer className="border-t px-5 py-8 text-center text-sm">
|
|
Investe Moçambique ·{' '}
|
|
<Link href="/apoio" className="underline">
|
|
Apoio ao Investidor
|
|
</Link>{' '}
|
|
·{' '}
|
|
<Link href="/documentos" className="underline">
|
|
Documentos e Formulários
|
|
</Link>
|
|
</footer>
|
|
</div>
|
|
);
|
|
}
|