import { ProactiveSummary } from '@/components/proactive-investment'; import EducationalGuides from '@/components/educational-guides'; import InvestmentComplements, { type ComplementOption, } from '@/components/investment-complements'; import { searchTerritoryHref, investmentPreparationHref, } from '@/lib/search-territory'; import type { EducationalArticle } from '@/components/educational-article-card'; import { ClassificationSummary } from '@/components/opportunity-classification'; import { Head, Link, router, usePage } from '@inertiajs/react'; import { opportunityDescription, recordedVerificationDate, } from '@/lib/opportunity-information'; import { useState } from 'react'; import { downloadPublicOpportunityOffline } from '@/lib/public-opportunity-offline'; import InvestmentMapPanel from '@/components/investment-map-panel'; import StructureGeographyPanel, { LocationList, } from '@/components/structure-geography'; import PartnershipSourceLinks from '@/components/partnership-source-links'; import TerritorialSources from '@/components/territorial-source-evidence'; import { Frame, card, button, money, groupLabels } from './shared'; import type { Opportunity, Context } from './shared'; export default function Detail({ complements = [], guides = [], record: r, context: c, zone_origin, returnUrl = '/oportunidades', dossierOrigin, }: { complements?: ComplementOption[]; guides?: EducationalArticle[]; record: Opportunity; context: Context; zone_origin?: { id: string; name: string } | null; returnUrl?: string; dossierOrigin?: { id: string; title: string } | null; }) { const page = usePage<{ auth: { user: unknown } }>(); const { auth } = page.props; const dossierContext = new URLSearchParams( page.url.split('?')[1] ?? '', ).get('context'); const [sharing, setSharing] = useState(''); const [offlineMessage, setOfflineMessage] = useState(''); return ( {r.maturity_label === 'Em preparação' && (

Em preparação. Consulte a oportunidade e prepare o seu investimento. A execução depende das condições e autorizações aplicáveis ao projecto.

)} Iniciar ou continuar investimento com esta oportunidade {auth.user && dossierContext && ( )} Voltar à pesquisa {dossierOrigin && (

Voltar ao dossier: {dossierOrigin.title}

)}

{r.reference} · {r.sector?.name} · {r.province} {r.district}

{r.summary}

{offlineMessage}

Onde se localiza

As relações cadastradas não confirmam disponibilidade ou capacidade. Locais dos projetos associados, áreas de impacto e abrangência dos clusters são apresentados separadamente.

{!c.opportunity_locations?.length && (

Implantação estruturada não documentada. O contexto associado abaixo não confirma onde a oportunidade será implantada.

)}
{c.primary_territory_path && c.primary_territory_path.length > 0 && (

Território principal cadastrado (implantação por confirmar):{' '} {c.primary_territory_path .map((node) => node.name) .join(' → ')}

)}
Iniciar ou continuar o roteiro deste investimento {auth.user ? ( ) : ( Entrar para preparar manifestação )} Contacto rápido sem rascunho
{sharing &&

{sharing}

} {!!c.zones?.length && (

ZEE, ZFI e parques associados

{c.zones.map((z) => (

{z.name} {' '} ·{' '} {z.association_type === 'official' ? 'Associação documental validada' : 'Relação ' + z.association_type}{' '} · Fonte: {z.source_reference}

))}

A associação não atribui automaticamente benefícios ou licenças.

)}

O investimento

{r.description || 'Descrição por completar.'}
{[ ['Promotor', r.promoter_name], [ 'Última verificação registada', recordedVerificationDate(r.last_validated_at), ], ['Investimento', money(r)], ['Maturidade', r.maturity_label], [ 'Classificação da preparação', r.maturity_catalogue_version === 'spec-v2' ? 'Etapas de preparação' : r.maturity_catalogue_version === 'legacy-v1' ? 'Histórico — seis níveis' : 'Versão não registada', ], ['Parceria', r.financing_modality], ['Impacto', r.expected_impact], ['Calendário', c.profile?.target_date], ].map(([key, value]) => (
{key}
{value || 'Não indicado'}
))}
{c.profile && (

Viabilidade e preparação

{[ ['Modelo de negócio', c.profile.business_model], ['Requisitos', c.profile.requirements], ['Riscos', c.profile.risks], ['Fonte', c.profile.source_reference], ].map(([label, text]) => (

{label}

{text || 'Não indicado'}

))} {c.profile.is_education && ( Explorar oportunidades na educação )}
)}
{( ['clusters', 'corridors', 'projects', 'locations'] as const ).map((key, i) => (

{ [ 'Clusters', 'Corredores', 'Projectos âncora', 'Referências territoriais anteriores', ][i] }

{c[key].map((entity) => (

{entity.dossiers?.map((dossier) => ( Consultar dossier: {dossier.title}
))} c[key] .filter( (entity) => entity.geography && entity.dossiers?.length, ) .map((entity) => ( )), )}

Infraestruturas, competências, educação e apoios

{c.facets.map((f) => (

{groupLabels[f.group] ?? f.group}: {f.label}

))} {!c.facets.length && (

Sem características estruturadas publicadas. Pode declarar as suas necessidades na manifestação de interesse.

)}
); }