@@ -4,11 +4,15 @@ import { Frame, Field, input, button, card } from './shared';
|
||||
import type { References } from './shared';
|
||||
import { Conversation } from './conversation';
|
||||
import type { Message } from './conversation';
|
||||
import CountrySelect, { type Country } from '@/components/country-select';
|
||||
type Payload = {
|
||||
full_name: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
country: string;
|
||||
residence_country_code: string;
|
||||
incorporation_country_code: string;
|
||||
declared_origin_country_code: string;
|
||||
organisation: string;
|
||||
representative_role: string;
|
||||
experience: string;
|
||||
@@ -51,6 +55,7 @@ type Need = {
|
||||
};
|
||||
};
|
||||
type Props = {
|
||||
countries: Country[];
|
||||
zone_origin?: {
|
||||
zone_id: string;
|
||||
zone_version: number;
|
||||
@@ -119,12 +124,16 @@ function Editor({
|
||||
revisions,
|
||||
step,
|
||||
setStep,
|
||||
countries,
|
||||
}: Props & { step: number; setStep: (step: number) => void }) {
|
||||
const initial: Payload = {
|
||||
full_name: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
country: '',
|
||||
residence_country_code: '',
|
||||
incorporation_country_code: '',
|
||||
declared_origin_country_code: '',
|
||||
organisation: '',
|
||||
representative_role: '',
|
||||
experience: '',
|
||||
@@ -349,7 +358,12 @@ function Editor({
|
||||
{text('full_name', 'Nome completo', true)}
|
||||
{text('email', 'Email', true, 'email')}
|
||||
{text('phone', 'Telefone')}
|
||||
{text('country', 'País', true)}
|
||||
{form.data.payload.country && <p>País anteriormente registado: {form.data.payload.country}. Não foi convertido em residência, constituição ou origem.</p>}
|
||||
{(['residence_country_code', 'incorporation_country_code', 'declared_origin_country_code'] as const).map((key) => <Field key={key} label={{ residence_country_code: 'País de residência', incorporation_country_code: 'País de constituição da entidade', declared_origin_country_code: 'País de origem declarado desta solicitação' }[key]}>
|
||||
<CountrySelect disabled={readonly} id={key} countries={countries} value={form.data.payload[key] ?? ''} onChange={(value) => form.setData('payload', { ...form.data.payload, [key]: value })} />
|
||||
{form.errors[`payload.${key}`] && <p role="alert">{form.errors[`payload.${key}`]}</p>}
|
||||
</Field>)}
|
||||
<p>A origem da solicitação é uma declaração sua; não é deduzida da residência, da entidade ou do endereço IP.</p>
|
||||
{option(
|
||||
'profile_id',
|
||||
'investor_profile',
|
||||
|
||||
Reference in New Issue
Block a user