{allRidersLoading && (
Loading riders…
)}
{rows?.length === 0 && !allRidersLoading && (
No riders to show
{searchword
? 'Try a different keyword.'
: `No ${tabvalue === 0 ? '' : 'active '}riders for this zone.`}
)}
{rows?.length !== 0 &&
rows?.map((row, index) => {
const statusMeta = getRowStatusMeta(row);
const StatusIcon = statusMeta.icon;
const expanded = logsRow === row.userid;
return (
{String(index + 1).padStart(2, '0')}
#{row?.userid}
{statusMeta.label}
{roleid == 1 && (
{
navigate('/nearle/riders/edit', { state: { riderdata: row } });
}}
>
{tabvalue != 0 && (
{
if (row.userid == logsRow) {
setLogsRow(null);
} else {
setLogsRow(row.userid);
getRiderLogs(row.userid);
}
}}
>
{expanded ? : }
)}
)}
{(row.fullname || row.username || '?').charAt(0).toUpperCase()}
{row.username || '—'}
{row.contactno || '—'}
}
>
{row.suburb || (row.address ? row.address.slice(0, 20) + '…' : '—')}
{row.city || ''}
{row.vehicleno || '—'}
{row.starttime ? dayjs(`${dayjs().format('MM-DD-YYYY')} ${row.starttime}`).format('hh:mm A') : '—'}
{row.endtime ? dayjs(`${dayjs().format('MM-DD-YYYY')} ${row.endtime}`).format('hh:mm A') : '—'}
{expanded && tabvalue !== 0 && (
Live telemetry — {row.username || `Rider #${row.userid}`}
)}
);
})}
{rows?.length !== 0 && (
{isFetchingNextPage || hasNextPage ? (
) : (
No more riders
)}
)}
) : (