import React from 'react' import Avatar from "../../components/common/Avatar"; // <-- ADD THIS import { useExpenseAllTransactionsList } from '../../hooks/useExpense'; import { useNavigate } from 'react-router-dom'; import { formatFigure } from '../../utils/appUtils'; const AdvancePaymentList1 = ({ searchString }) => { const { data, isError, isLoading, error } = useExpenseAllTransactionsList(searchString); const rows = data || []; const navigate = useNavigate(); const columns = [ { key: "employee", label: "Employee Name", align: "text-start", customRender: (r) => (
navigate(`/advance-payment/${r.id}`)} style={{ cursor: "pointer" }}> {r.firstName} {r.lastName}
), }, { key: "jobRoleName", label: "Job Role", align: "text-start", customRender: (r) => ( {r.jobRoleName} ), }, { key: "balanceAmount", label: "Balance (₹)", align: "text-end", customRender: (r) => ( {formatFigure(r.balanceAmount, { // type: "currency", currency: "INR", })} ), }, ]; if (isLoading) return

Loading...

; if (isError) return

{error.message}

; return (
{columns.map((col) => ( ))} {rows.length > 0 ? ( rows.map((row) => ( {columns.map((col) => ( ))} )) ) : ( )}
{col.label}
{col.customRender ? col.customRender(row) : col.getValue(row)}
No Employees Found
) } export default AdvancePaymentList1;