import { Head, Link, useForm } from '@inertiajs/react'; import { useState } from 'react'; export type InvestmentContext = { id: string; title: string; version: number; updated_at: string; }; export default function InvestmentContexts({ contexts, }: { contexts: InvestmentContext[]; }) { const [key] = useState(() => globalThis.crypto.randomUUID()); const form = useForm({ title: '', client_key: key, reuse_consent: false }); return (

Os meus investimentos

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}

))}
); }