62 lines
2.3 KiB
TypeScript
62 lines
2.3 KiB
TypeScript
import { Link, useForm } from '@inertiajs/react';
|
|
import { Management, Pagination, control, button } from '../management/shared';
|
|
import type { Paginated } from '../management/shared';
|
|
|
|
export default function Investors({
|
|
investors,
|
|
filters,
|
|
}: {
|
|
investors: Paginated<{ id: string; legal_name: string; status: string }>;
|
|
filters: { q?: string };
|
|
}) {
|
|
const form = useForm({ q: filters.q ?? '' });
|
|
return (
|
|
<Management title="CRM — Investidores">
|
|
<form
|
|
className="flex gap-3"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
form.get('/management/crm/investors', {
|
|
preserveState: false,
|
|
});
|
|
}}
|
|
>
|
|
<input
|
|
aria-label="Pesquisar investidores"
|
|
className={control}
|
|
value={form.data.q}
|
|
onChange={(e) => form.setData('q', e.target.value)}
|
|
/>
|
|
<button className={button} disabled={form.processing}>
|
|
Pesquisar
|
|
</button>
|
|
</form>
|
|
<p>
|
|
Os novos investidores são registados ao converter um pedido em
|
|
lead, com revisão do contacto e da identidade.
|
|
</p>
|
|
<div className="space-y-3">
|
|
{investors.data.map((investor) => (
|
|
<article key={investor.id} className="rounded border p-4">
|
|
<Link
|
|
className="font-semibold underline"
|
|
href={`/management/crm/investors/${investor.id}`}
|
|
>
|
|
{investor.legal_name}
|
|
</Link>
|
|
<p>
|
|
{{
|
|
prospect: 'Potencial investidor',
|
|
active: 'Activo',
|
|
inactive: 'Inactivo',
|
|
}[investor.status] ?? investor.status}
|
|
</p>
|
|
</article>
|
|
))}
|
|
</div>
|
|
{!investors.data.length && <p>Nenhum investidor encontrado.</p>}
|
|
<Pagination page={investors} />
|
|
</Management>
|
|
);
|
|
}
|