Compare commits

...

2 Commits

Author SHA1 Message Date
victorAnumudu 01c1c62bf0 fixed user endpoint data 2025-09-18 17:35:52 +01:00
ameye db4ecdd55b Merge branch 'login-input-length' of MERMS/MermsFirstOffice into master 2025-09-14 21:17:12 +00:00
+34 -48
View File
@@ -6,7 +6,8 @@ import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
import Icons from '../Icons'
import { getUsers } from '../../services/siteServices'
import formatNumber from '../../helpers/formatNumber'
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
// import formatNumber from '../../helpers/formatNumber'
// import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString';
// import formatNumber from '../../helpers/formatNumber'
// import Avatar from '../../assets/user_avatar.jpg'
@@ -47,9 +48,9 @@ export default function UsersAdmin() {
},
staleTime: 0 //0 mins
})
const usersData = data?.data?.payments // BILLINGS LIST
const usersData = data?.data?.office_users // USERS LIST
const pagination = data?.data?.pagination
// console.log('DATA', data?.data)
console.log('DATA', data?.data)
return (
<div className='w-full flex flex-col gap-8'>
@@ -83,25 +84,22 @@ export default function UsersAdmin() {
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
Name
ID
</th>
<th scope="col" className="px-2 text-right">
Interest Rate
<th scope="col" className="px-2">
Added
</th>
<th scope="col" className="px-2 text-right">
Insurance Rate
<th scope="col" className="px-2">
Firstnane
</th>
<th scope="col" className="px-2 text-right">
Mgt. Rate
<th scope="col" className="px-2">
Lastname
</th>
<th scope="col" className="px-2 text-right">
Max/Min Amount
<th scope="col" className="px-2">
Username
</th>
<th scope="col" className="px-2 text-right">
Tenor
</th>
<th scope="col" className="px-2 text-right">
Action
<th scope="col" className="px-2">
Acct. Level
</th>
</tr>
</thead>
@@ -109,52 +107,40 @@ export default function UsersAdmin() {
{(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
{/* <img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese" /> */}
<div className="text-left">
<div className="text-base font-semibold">{item?.product_id || ''}</div>
{/* <div className="font-normal text-gray-500 line-clamp-1">{item?.description}</div> */}
</div>
</div>
<div className="text-left">
<div className="text-base font-semibold">{item?.id}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{formatNumber(item?.interest_rate)}</div>
</div>
<div className="">
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{formatNumber(item?.insurance_rate)}</div>
</div>
<div className="text-left">
<div className="text-base font-semibold">{item?.firstname}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{formatNumber(item?.management_rate)}</div>
</div>
<div className="">
<div className="text-base font-semibold">{item?.lastname}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{formatNumber(item?.maximum_amount)}</div>
<div className="font-normal text-gray-500">{formatNumber(item?.minimum_amount)}</div>
</div>
<div className="text-left">
<div className="text-base font-semibold">{item?.username}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{item?.tenor}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='eye' />
</div>
</div>
<div className="text-left">
<div className="text-base font-semibold">{item?.acc_level}</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={7}>
<td className="px-3 py-2" colSpan={6}>
<div className="flex justify-center items-center">
No Record Found
</div>