@@ -32,7 +32,11 @@ export default function Interests({
|
||||
className="flex flex-wrap gap-3"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
router.get('/management/interests', { q, status, follow_up: followUp });
|
||||
router.get('/management/interests', {
|
||||
q,
|
||||
status,
|
||||
follow_up: followUp,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<input
|
||||
@@ -49,15 +53,39 @@ export default function Interests({
|
||||
onChange={(e) => setStatus(e.target.value)}
|
||||
>
|
||||
<option value="">Todos os estados</option>
|
||||
{Object.keys(states).filter((key) => ['received', 'submitted', 'in_review', 'reviewed', 'qualification', 'qualified', 'contacted', 'contact_accepted', 'referred', 'due_diligence', 'negotiation', 'pending', 'refused', 'converted', 'cancelled', 'closed'].includes(key)).map(
|
||||
(key) => (
|
||||
{Object.keys(states)
|
||||
.filter((key) =>
|
||||
[
|
||||
'received',
|
||||
'submitted',
|
||||
'in_review',
|
||||
'reviewed',
|
||||
'qualification',
|
||||
'qualified',
|
||||
'contacted',
|
||||
'contact_accepted',
|
||||
'referred',
|
||||
'due_diligence',
|
||||
'negotiation',
|
||||
'pending',
|
||||
'refused',
|
||||
'converted',
|
||||
'cancelled',
|
||||
'closed',
|
||||
].includes(key),
|
||||
)
|
||||
.map((key) => (
|
||||
<option key={key} value={key}>
|
||||
{states[key]}
|
||||
</option>
|
||||
),
|
||||
)}
|
||||
))}
|
||||
</select>
|
||||
<select aria-label="Acompanhamento" className={`${control} max-w-xs`} value={followUp} onChange={(e) => setFollowUp(e.target.value)}>
|
||||
<select
|
||||
aria-label="Acompanhamento"
|
||||
className={`${control} max-w-xs`}
|
||||
value={followUp}
|
||||
onChange={(e) => setFollowUp(e.target.value)}
|
||||
>
|
||||
<option value="">Todos os acompanhamentos</option>
|
||||
<option value="overdue">Acções atrasadas</option>
|
||||
<option value="upcoming">Acções por vencer</option>
|
||||
@@ -105,12 +133,23 @@ export default function Interests({
|
||||
{item.sector_interest}
|
||||
</td>
|
||||
<td className="border-b p-3">
|
||||
{item.modality ?? (item.existing_business_id ? 'Negócio' : '—')}
|
||||
{item.modality ??
|
||||
(item.existing_business_id
|
||||
? 'Negócio'
|
||||
: '—')}
|
||||
</td>
|
||||
<td className="border-b p-3">{item.assignee?.name ?? '—'}</td>
|
||||
<td className="border-b p-3">{item.next_action ?? '—'}</td>
|
||||
<td className={`border-b p-3 ${item.next_action_due_at && new Date(item.next_action_due_at) < new Date() ? 'font-semibold text-red-700' : ''}`}>
|
||||
{item.next_action_due_at ? `${new Date(item.next_action_due_at) < new Date() ? 'Atrasada · ' : ''}${new Intl.DateTimeFormat('pt-MZ', { dateStyle: 'medium', timeZone: 'Africa/Maputo' }).format(new Date(item.next_action_due_at))}` : '—'}
|
||||
<td className="border-b p-3">
|
||||
{item.assignee?.name ?? '—'}
|
||||
</td>
|
||||
<td className="border-b p-3">
|
||||
{item.next_action ?? '—'}
|
||||
</td>
|
||||
<td
|
||||
className={`border-b p-3 ${item.next_action_due_at && new Date(item.next_action_due_at) < new Date() ? 'font-semibold text-red-700' : ''}`}
|
||||
>
|
||||
{item.next_action_due_at
|
||||
? `${new Date(item.next_action_due_at) < new Date() ? 'Atrasada · ' : ''}${new Intl.DateTimeFormat('pt-MZ', { dateStyle: 'medium', timeZone: 'Africa/Maputo' }).format(new Date(item.next_action_due_at))}`
|
||||
: '—'}
|
||||
</td>
|
||||
<td className="border-b p-3">
|
||||
{states[item.status] ?? item.status}
|
||||
|
||||
Reference in New Issue
Block a user