diff --git a/resources/js/pages/investor-path/index.tsx b/resources/js/pages/investor-path/index.tsx index 6416d8f3..ecd7a10c 100644 --- a/resources/js/pages/investor-path/index.tsx +++ b/resources/js/pages/investor-path/index.tsx @@ -77,6 +77,63 @@ export default function InvestmentContexts({ : {}), ...(guideSelection ? { investment_guide: guideSelection } : {}), }); + // A new reference (park, sector, article) is only kept through the explicit + // "continuar" action; opening an old dossier by its title would drop it. + const carrying = Boolean(zoneSource || sectorSource || contentSource); + const createForm = ( +
{ + event.preventDefault(); + form.post('/investimentos'); + }} + > +

+ {carrying + ? 'Criar um dossier novo para esta ideia' + : 'Preparar um investimento'} +

+ {carrying && ( +

+ A referência escolhida fica guardada no dossier novo. Os + dossiers que já tem não são alterados. +

+ )} + + + {Object.values(form.errors).map((error, index) => ( +

+ {error} +

+ ))} + +
+ ); return (
@@ -155,13 +212,24 @@ export default function InvestmentContexts({

)} -

- Prepare cada investimento no seu dossier. Pode trabalhar em - várias etapas em paralelo. -

+ {carrying && createForm} + {carrying && contexts.length > 0 ? ( +

+ Ou continuar num dossier que já tem +

+ ) : ( +

+ Prepare cada investimento no seu dossier. Pode trabalhar + em várias etapas em paralelo. +

+ )} {!contexts.length && (

Ainda não criou um investimento neste percurso.

)} -
{ - event.preventDefault(); - form.post('/investimentos'); - }} - > -

- Preparar um investimento -

- - - {Object.values(form.errors).map((error, index) => ( -

- {error} -

- ))} - -
+ {!carrying && createForm}