add prefix $ on table wallet rule
This commit is contained in:
@ -79,6 +79,14 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const currencyFormat = (value: number) =>
|
||||||
|
new Intl.NumberFormat('en-US', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'USD',
|
||||||
|
minimumFractionDigits: 0,
|
||||||
|
maximumFractionDigits: 0
|
||||||
|
}).format(value);
|
||||||
|
|
||||||
const columns = useMemo<ColumnDef<any>[]>(
|
const columns = useMemo<ColumnDef<any>[]>(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
@ -87,9 +95,7 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Wallet Name" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Wallet Name" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
headerClassName: 'w-[250px]'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.group.name,
|
accessorFn: (row) => row.group.name,
|
||||||
@ -97,9 +103,7 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Group Name" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Group Name" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
headerClassName: 'w-[250px]'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.balance_minimum,
|
accessorFn: (row) => row.balance_minimum,
|
||||||
@ -107,9 +111,8 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Balance Minimum" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Balance Minimum" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
cell: ({ row }) => currencyFormat(row.original.balance_minimum),
|
||||||
headerClassName: 'w-[250px]'
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.balance_maximum,
|
accessorFn: (row) => row.balance_maximum,
|
||||||
@ -117,9 +120,8 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Balance Maximum" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Balance Maximum" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
cell: ({ row }) => currencyFormat(row.original.balance_maximum),
|
||||||
headerClassName: 'w-[250px]'
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.credit_limit,
|
accessorFn: (row) => row.credit_limit,
|
||||||
@ -127,9 +129,8 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Credit Limit" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Credit Limit" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
cell: ({ row }) => currencyFormat(row.original.credit_limit),
|
||||||
headerClassName: 'w-[250px]'
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.max_transaction_per_day,
|
accessorFn: (row) => row.max_transaction_per_day,
|
||||||
@ -139,9 +140,8 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
),
|
),
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
cell: ({ row }) => currencyFormat(row.original.max_transaction_per_day),
|
||||||
headerClassName: 'w-[250px]'
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.monthly_limit,
|
accessorFn: (row) => row.monthly_limit,
|
||||||
@ -149,9 +149,8 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
header: ({ column }) => <DataGridColumnHeader title="Monthly Limit" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="Monthly Limit" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
cell: ({ row }) => currencyFormat(row.original.monthly_limit),
|
||||||
headerClassName: 'w-[250px]'
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.status,
|
accessorFn: (row) => row.status,
|
||||||
@ -161,7 +160,6 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const isActive = row.original.status === 'Y';
|
const isActive = row.original.status === 'Y';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className={`px-2 py-1 text-xs font-semibold rounded-full ${
|
className={`px-2 py-1 text-xs font-semibold rounded-full ${
|
||||||
@ -192,12 +190,6 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
|
|||||||
>
|
>
|
||||||
<KeenIcon icon="notepad-edit" />
|
<KeenIcon icon="notepad-edit" />
|
||||||
</button>
|
</button>
|
||||||
{/* <button
|
|
||||||
className="btn btn-sm btn-icon btn-clear btn-light"
|
|
||||||
onClick={() => handleDeleteDialog(true, row)}
|
|
||||||
>
|
|
||||||
<KeenIcon icon="trash" />
|
|
||||||
</button> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user