oportunidades 4
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-10 07:03:59 +02:00
parent e662230df7
commit 6ddafc95ba
179 changed files with 22750 additions and 933 deletions
+30 -4
View File
@@ -3,6 +3,7 @@ import { router } from '@inertiajs/react';
import { PortalMenu } from '@/layouts/portal-navigation';
import { ProvinceSelect } from '@/components/investment-territory';
import { MATURITY_LEVELS } from '@/lib/investment-maturity';
import CountrySelect, { type Country } from '@/components/country-select';
import type { Dispatch, FormEvent, ReactNode, SetStateAction } from 'react';
import type { LucideIcon } from 'lucide-react';
import { usePortalQuery } from '@/hooks/use-portal-query';
@@ -668,9 +669,11 @@ function OpportunityDetail({
function InterestForm({
preselected,
onSubmitted,
countries,
}: {
preselected: Opportunity | null;
onSubmitted: () => void;
countries: Country[];
}) {
const sectors = useContext(SectorContext);
const [submitting, setSubmitting] = useState(false);
@@ -682,7 +685,8 @@ function InterestForm({
email: '',
phone: '',
investorType: '',
country: 'Moçambique',
country: '',
declared_origin_country_code: '',
sectorInterest: preselected?.sectorName ?? '',
opportunityReference: preselected ? preselected.reference : '',
investmentRange: '',
@@ -857,13 +861,32 @@ function InterestForm({
</Field>
<Field label="País" error={errors.country}>
<input
className="input"
<CountrySelect
countries={countries}
value={form.country}
onChange={(e) => update('country', e.target.value)}
onChange={(value) => update('country', value)}
required
allowLegacyValue
/>
</Field>
<Field
label="País de origem declarado desta solicitação"
error={errors.declared_origin_country_code}
>
<CountrySelect
countries={countries}
value={form.declared_origin_country_code ?? ''}
onChange={(value) =>
update('declared_origin_country_code', value)
}
/>
<p className="text-sm">
Origem opcional; não é deduzida do país acima nem do
IP.
</p>
</Field>
<Field
label="Sector de interesse"
error={errors.sectorInterest}
@@ -1013,12 +1036,14 @@ export default function PortalInvestidorApp({
initialSector = '',
initialQuery = '',
essentialResources = [],
countries = [],
}: {
initialView?: View;
initialOpportunity?: OpportunityRecord;
initialSector?: string;
initialQuery?: string;
essentialResources?: { id: number; title: string }[];
countries?: Country[];
}) {
const view = initialView;
const home = usePortalQuery<HomeResponse>('/api/v1/home');
@@ -1299,6 +1324,7 @@ export default function PortalInvestidorApp({
<InterestForm
key={selected?.reference ?? 'general'}
preselected={selected}
countries={countries}
onSubmitted={() => setRequestCount((c) => c + 1)}
/>
)}