fixing filter on tranfer type
This commit is contained in:
@ -39,10 +39,31 @@ const ListToolbar = () => {
|
||||
const types = unique(transferTypes.map((t) => t.type));
|
||||
const origins = unique(transferTypes.map((t) => t.wallet_origin.name));
|
||||
const destinations = unique(transferTypes.map((t) => t.wallet_destination.name));
|
||||
const typeLabelMap: Record<string, string> = {
|
||||
D: 'Disbursement',
|
||||
O: 'Other',
|
||||
CA: 'Change Group Emoney Customer to Agent',
|
||||
AC: 'Change Group Emoney Agent to Customer',
|
||||
PC: 'Change Group Point Agent to Customer',
|
||||
PA: 'Change Group Point Customer to Agent',
|
||||
CE: 'Return Customer Emoney',
|
||||
AD: 'Return Agent Deposit',
|
||||
AM: 'Return Agent Merchant',
|
||||
AE: 'Return Agent Emoney',
|
||||
R: 'Reward Point',
|
||||
TE: 'Top Up Escrow',
|
||||
TM: 'Top Up Master Agent',
|
||||
TA: 'Top Up Agent',
|
||||
PL: 'Purchase Loja',
|
||||
DE: 'Disbursment Escrow',
|
||||
DM: 'Disbursment Master Agent',
|
||||
DA: 'Disbursment Agent',
|
||||
WI: 'Withdraw Merchant',
|
||||
IC: 'Income Merchant'
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
|
||||
table.getColumn('name')?.setFilterValue(searchValue);
|
||||
table.setPageIndex(0);
|
||||
}, 200);
|
||||
@ -106,7 +127,8 @@ const ListToolbar = () => {
|
||||
placeholder: string,
|
||||
value: string,
|
||||
onChange: (val: string) => void,
|
||||
options: string[]
|
||||
options: string[],
|
||||
labelMap?: Record<string, string>
|
||||
) => (
|
||||
<div className="min-w-[220px]">
|
||||
<Select value={value === '' ? undefined : value} onValueChange={onChange}>
|
||||
@ -116,7 +138,7 @@ const ListToolbar = () => {
|
||||
<SelectContent>
|
||||
{options.map((opt) => (
|
||||
<SelectItem key={opt} value={opt}>
|
||||
{opt}
|
||||
{labelMap?.[opt] ?? opt}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
@ -124,6 +146,7 @@ const ListToolbar = () => {
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<div className="card-header flex-wrap gap-2 border-b-0 px-5">
|
||||
<div className="flex flex-wrap gap-2 lg:gap-5 w-full">
|
||||
@ -161,7 +184,13 @@ const ListToolbar = () => {
|
||||
|
||||
{/* Filter bar */}
|
||||
<div className="flex flex-wrap gap-2 w-full">
|
||||
{renderSelect('Select Status Transaction Type', statusTypes, setStatusTypes, types)}
|
||||
{renderSelect(
|
||||
'Select Status Transaction Type',
|
||||
statusTypes,
|
||||
setStatusTypes,
|
||||
types,
|
||||
typeLabelMap
|
||||
)}
|
||||
{renderSelect('Select Status Approval', approval, setApproval, ['Y', 'N'])}
|
||||
{/* {renderSelect('Select Origin Wallet', walletOrigins, setWalletOrigin, origins)}
|
||||
{renderSelect(
|
||||
|
||||
Reference in New Issue
Block a user