import { Link, useForm } from '@inertiajs/react'; import { Management, Field, control, button } from '../management/shared'; import { leadStates } from './types'; type Contact = { id: string; full_name: string; email: string | null; phone: string | null; }; function ContactForm({ contact, investorId, }: { contact: Contact; investorId: string; }) { const form = useForm({ full_name: contact.full_name, email: contact.email ?? '', phone: contact.phone ?? '', }); return (
{ e.preventDefault(); form.patch( `/management/crm/investors/${investorId}/contacts/${contact.id}`, ); }} > form.setData('full_name', e.target.value)} /> form.setData('email', e.target.value)} /> form.setData('phone', e.target.value)} />
); } export default function InvestorDetail({ investor, contacts, leads, }: { investor: { id: string; legal_name: string; investor_type: string; status: string; }; contacts: Contact[]; leads: { id: string; title: string; status: string }[]; }) { const form = useForm({ legal_name: investor.legal_name, investor_type: investor.investor_type, status: investor.status, }); return (
{ e.preventDefault(); form.patch(`/management/crm/investors/${investor.id}`); }} > form.setData('legal_name', e.target.value) } />

Contactos

Um contacto pode representar vários investidores. Alterações ao contacto são partilhadas entre essas relações.

{contacts.map((contact) => ( ))}

Leads associados

{leads.map((lead) => (

{lead.title} {' '} · {leadStates[lead.status]}

))}
); }