import { Link, router, useForm } from '@inertiajs/react'; import { Frame, Field, input, button, card } from './shared'; import PartnershipSourceLinks from '@/components/partnership-source-links'; import CountrySelect, { type Country } from '@/components/country-select'; import { useEffect, useId } from 'react'; type RecordData = { version: number; payload: Record }; type Company = RecordData & { id: string; countrySource?: { organization_id: string; organization_version: number; country: string; } | null; }; type Organization = { id: string; name: string; version: number; country: string | null; canEdit: boolean; provenance: { reference: string; kind: string } | null; }; const labels: Record = { phone: 'Telefone', country: 'País anteriormente registado', residence_country_code: 'País de residência do investidor', incorporation_country_code: 'País de constituição da entidade', sector: 'Sector de interesse', experience: 'Experiência relevante', investment_capacity: 'Capacidade de investimento declarada', name: 'Nome da empresa', registration: 'Referência de registo / NUIT', role: 'Função ou relação com a empresa', description: 'Actividade e observações', }; export default function Profile({ account, companies, countries, organizations = [], organizationCountryAvailable = false, }: { account: RecordData; companies: Company[]; countries: Country[]; organizations?: Organization[]; organizationCountryAvailable?: boolean; }) { return ( Voltar à área do investidor

Estes dados são privados e servem para preencher novas manifestações. Nome e email são mantidos nas{' '} definições da conta .

Empresas declaradas

Declarar uma empresa não comprova representação legal nem concede acesso aos registos de outras pessoas. A equipa pode pedir evidência durante o atendimento.

{companies.map((company) => (

{company.payload.name}

{company.countrySource && (

País reutilizado: {company.countrySource.country}; organização{' '} {organizations.find( (o) => o.id === company.countrySource?.organization_id, )?.name ?? company.countrySource.organization_id} , versão{' '} {company.countrySource.organization_version}. O valor é uma cópia identificada; não é atualizado automaticamente quando o cadastro mestre muda.

)} {organizations .filter((o) => o.country) .map((org) => (

País mestre de {org.name}: {org.country}. A reutilização altera somente esta declaração; manifestações anteriores conservam o seu valor.

))}
))} {companies.length < 20 && (

Acrescentar empresa

)}

Organizações representadas — cadastro mestre

O país de constituição é independente da residência e da origem da solicitação. Não se associa uma empresa privada a uma organização por semelhança de nome. A declaração do representante não é uma decisão externa nem comprova por si a representação legal.

{!organizationCountryAvailable && (

Extensão do país de constituição ainda não instalada neste ambiente.

)} {organizationCountryAvailable && organizations.length === 0 && (

Sem representação organizacional registada para esta conta.

)} {organizations.map((org) => ( ))} ); } function OrganizationEditor({ organization, countries, }: { organization: Organization; countries: Country[]; }) { const form = useForm({ version: organization.version, country: organization.country ?? '', source_reference: organization.provenance?.reference ?? '', }); const id = useId(); useEffect(() => { if (Object.keys(form.errors).length) document .getElementById(id) ?.querySelector('[aria-invalid="true"]') ?.focus(); }, [form.errors, id]); return (

{organization.name}

Versão {organization.version}; origem do país:{' '} {organization.provenance?.kind === 'representative_declaration' ? 'declaração do representante' : 'não informada'} .

{ event.preventDefault(); form.put( `/investidor/organizations/${organization.id}/country`, { preserveScroll: true }, ); }} > form.setData('country', country)} />