@@ -3,6 +3,7 @@ import { Link } from '@inertiajs/react';
|
||||
import type { FormEvent } from 'react';
|
||||
import { newSubmissionKey } from '@/lib/portal-api';
|
||||
import { Frame, Field, button, card, input } from './shared';
|
||||
import CountrySelect, { type Country } from '@/components/country-select';
|
||||
|
||||
type Opportunity = {
|
||||
id: string;
|
||||
@@ -10,8 +11,14 @@ type Opportunity = {
|
||||
title: string;
|
||||
sector?: { name: string } | null;
|
||||
};
|
||||
type Props = { record: Opportunity; modalities: string[]; returnUrl?: string };
|
||||
type Props = {
|
||||
record: Opportunity;
|
||||
modalities: string[];
|
||||
returnUrl?: string;
|
||||
countries: Country[];
|
||||
};
|
||||
type Form = {
|
||||
declared_origin_country_code: string;
|
||||
fullName: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
@@ -29,13 +36,15 @@ export default function BusinessInterest({
|
||||
record,
|
||||
modalities,
|
||||
returnUrl = '/negocios',
|
||||
countries,
|
||||
}: Props) {
|
||||
const [form, setForm] = useState<Form>({
|
||||
declared_origin_country_code: '',
|
||||
fullName: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
investorType: 'empresa',
|
||||
country: 'MZ',
|
||||
country: '',
|
||||
sectorInterest: record.sector?.name ?? '',
|
||||
modality: modalities[0] ?? '',
|
||||
investmentRange: '',
|
||||
@@ -114,6 +123,19 @@ export default function BusinessInterest({
|
||||
</section>
|
||||
) : (
|
||||
<form className={`${card} space-y-4`} onSubmit={submit}>
|
||||
<Field label="País de origem declarado desta solicitação">
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
value={form.declared_origin_country_code}
|
||||
onChange={(value) =>
|
||||
update('declared_origin_country_code', value)
|
||||
}
|
||||
/>
|
||||
<p className="text-sm">
|
||||
Origem opcional e independente do país do
|
||||
investidor.
|
||||
</p>
|
||||
</Field>
|
||||
<Field label="Nome ou denominação">
|
||||
<input
|
||||
className={input}
|
||||
@@ -161,12 +183,12 @@ export default function BusinessInterest({
|
||||
</select>
|
||||
</Field>
|
||||
<Field label="País">
|
||||
<input
|
||||
className={input}
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
required
|
||||
maxLength={100}
|
||||
allowLegacyValue
|
||||
value={form.country}
|
||||
onChange={(e) => update('country', e.target.value)}
|
||||
onChange={(value) => update('country', value)}
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Sector de interesse">
|
||||
|
||||
Reference in New Issue
Block a user