@bigbinary/neeto-payments-frontend 6.1.12 → 6.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/AccountsDashboard.js +308 -333
  2. package/dist/AccountsDashboard.js.map +1 -1
  3. package/dist/AdminCancelRecurringPaymentButton.js +43 -54
  4. package/dist/AdminCancelRecurringPaymentButton.js.map +1 -1
  5. package/dist/CashPaymentButton.js +32 -34
  6. package/dist/CashPaymentButton.js.map +1 -1
  7. package/dist/ConfirmCashPaymentButton.js +77 -71
  8. package/dist/ConfirmCashPaymentButton.js.map +1 -1
  9. package/dist/{CopyButtonWrapper-rv-OaINx.js → CopyButtonWrapper-Bp5IVO76.js} +16 -14
  10. package/dist/CopyButtonWrapper-Bp5IVO76.js.map +1 -0
  11. package/dist/CustomerCancelRecurringPaymentForm.js +76 -75
  12. package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -1
  13. package/dist/ExportModal-CoRuQVas.js +120 -0
  14. package/dist/ExportModal-CoRuQVas.js.map +1 -0
  15. package/dist/ManualUpiConnect.js +159 -178
  16. package/dist/ManualUpiConnect.js.map +1 -1
  17. package/dist/ManualUpiPayment.js +85 -89
  18. package/dist/ManualUpiPayment.js.map +1 -1
  19. package/dist/ManualUpiPaymentConfirmButton.js +119 -115
  20. package/dist/ManualUpiPaymentConfirmButton.js.map +1 -1
  21. package/dist/ManualUpiPaymentRejectButton.js +98 -92
  22. package/dist/ManualUpiPaymentRejectButton.js.map +1 -1
  23. package/dist/PaymentKindRestrictionAlert.js +14 -19
  24. package/dist/PaymentKindRestrictionAlert.js.map +1 -1
  25. package/dist/PaymentsDashboard.js +318 -349
  26. package/dist/PaymentsDashboard.js.map +1 -1
  27. package/dist/PayoutsDashboard.js +327 -350
  28. package/dist/PayoutsDashboard.js.map +1 -1
  29. package/dist/PayoutsPage.js +114 -92
  30. package/dist/PayoutsPage.js.map +1 -1
  31. package/dist/RazorpayConnect.js +71 -62
  32. package/dist/RazorpayConnect.js.map +1 -1
  33. package/dist/RazorpayLinkedAccountForm.js +145 -156
  34. package/dist/RazorpayLinkedAccountForm.js.map +1 -1
  35. package/dist/RazorpayPaymentButton.js +72 -100
  36. package/dist/RazorpayPaymentButton.js.map +1 -1
  37. package/dist/RecurringPaymentSettings.js +85 -85
  38. package/dist/RecurringPaymentSettings.js.map +1 -1
  39. package/dist/RefundsDashboard.js +363 -386
  40. package/dist/RefundsDashboard.js.map +1 -1
  41. package/dist/SplitTransfersDashboard.js +868 -829
  42. package/dist/SplitTransfersDashboard.js.map +1 -1
  43. package/dist/StripeCheckoutSetting.js +63 -75
  44. package/dist/StripeCheckoutSetting.js.map +1 -1
  45. package/dist/StripeConnect.js +257 -259
  46. package/dist/StripeConnect.js.map +1 -1
  47. package/dist/StripeManage.js +28 -25
  48. package/dist/StripeManage.js.map +1 -1
  49. package/dist/TaxesDashboard.js +284 -292
  50. package/dist/TaxesDashboard.js.map +1 -1
  51. package/dist/buildStripeTransactionLink.js +1 -1
  52. package/dist/cjs/AccountsDashboard.js +308 -333
  53. package/dist/cjs/AccountsDashboard.js.map +1 -1
  54. package/dist/cjs/AdminCancelRecurringPaymentButton.js +43 -54
  55. package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -1
  56. package/dist/cjs/CashPaymentButton.js +32 -34
  57. package/dist/cjs/CashPaymentButton.js.map +1 -1
  58. package/dist/cjs/ConfirmCashPaymentButton.js +77 -71
  59. package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -1
  60. package/dist/cjs/{CopyButtonWrapper-BkpN0Wmd.js → CopyButtonWrapper-I-kdKiiB.js} +16 -14
  61. package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js.map +1 -0
  62. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +76 -75
  63. package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -1
  64. package/dist/cjs/ExportModal-ClKqp-oy.js +122 -0
  65. package/dist/cjs/ExportModal-ClKqp-oy.js.map +1 -0
  66. package/dist/cjs/ManualUpiConnect.js +159 -178
  67. package/dist/cjs/ManualUpiConnect.js.map +1 -1
  68. package/dist/cjs/ManualUpiPayment.js +85 -89
  69. package/dist/cjs/ManualUpiPayment.js.map +1 -1
  70. package/dist/cjs/ManualUpiPaymentConfirmButton.js +118 -114
  71. package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -1
  72. package/dist/cjs/ManualUpiPaymentRejectButton.js +98 -92
  73. package/dist/cjs/ManualUpiPaymentRejectButton.js.map +1 -1
  74. package/dist/cjs/PaymentKindRestrictionAlert.js +14 -19
  75. package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
  76. package/dist/cjs/PaymentsDashboard.js +318 -349
  77. package/dist/cjs/PaymentsDashboard.js.map +1 -1
  78. package/dist/cjs/PayoutsDashboard.js +327 -350
  79. package/dist/cjs/PayoutsDashboard.js.map +1 -1
  80. package/dist/cjs/PayoutsPage.js +114 -92
  81. package/dist/cjs/PayoutsPage.js.map +1 -1
  82. package/dist/cjs/RazorpayConnect.js +71 -62
  83. package/dist/cjs/RazorpayConnect.js.map +1 -1
  84. package/dist/cjs/RazorpayLinkedAccountForm.js +145 -156
  85. package/dist/cjs/RazorpayLinkedAccountForm.js.map +1 -1
  86. package/dist/cjs/RazorpayPaymentButton.js +72 -100
  87. package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
  88. package/dist/cjs/RecurringPaymentSettings.js +85 -85
  89. package/dist/cjs/RecurringPaymentSettings.js.map +1 -1
  90. package/dist/cjs/RefundsDashboard.js +363 -386
  91. package/dist/cjs/RefundsDashboard.js.map +1 -1
  92. package/dist/cjs/SplitTransfersDashboard.js +867 -828
  93. package/dist/cjs/SplitTransfersDashboard.js.map +1 -1
  94. package/dist/cjs/StripeCheckoutSetting.js +63 -75
  95. package/dist/cjs/StripeCheckoutSetting.js.map +1 -1
  96. package/dist/cjs/StripeConnect.js +257 -259
  97. package/dist/cjs/StripeConnect.js.map +1 -1
  98. package/dist/cjs/StripeManage.js +28 -25
  99. package/dist/cjs/StripeManage.js.map +1 -1
  100. package/dist/cjs/TaxesDashboard.js +284 -292
  101. package/dist/cjs/TaxesDashboard.js.map +1 -1
  102. package/dist/cjs/buildStripeTransactionLink.js +1 -1
  103. package/dist/cjs/constants.js +1 -1
  104. package/dist/cjs/dashboard-B1R6fLcS.js +96 -0
  105. package/dist/cjs/dashboard-B1R6fLcS.js.map +1 -0
  106. package/dist/cjs/{exportChannel-D1Wls92m.js → exportChannel-BL2RGGhP.js} +16 -18
  107. package/dist/cjs/{exportChannel-D1Wls92m.js.map → exportChannel-BL2RGGhP.js.map} +1 -1
  108. package/dist/cjs/getAddressElementOptions.js +1 -1
  109. package/dist/cjs/getAmountInLargestCurrencyUnit.js +1 -1
  110. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
  111. package/dist/cjs/getAmountWithAppliedTax.js +1 -1
  112. package/dist/cjs/getFormattedAmount.js +1 -1
  113. package/dist/cjs/getFormattedDiscountedAmount.js +1 -1
  114. package/dist/cjs/getFormattedDiscountedPercentage.js +1 -1
  115. package/dist/cjs/getFormattedTaxAmount.js +1 -1
  116. package/dist/cjs/getFormattedTipAmount.js +1 -1
  117. package/dist/cjs/getQrCodeValue.js +1 -1
  118. package/dist/cjs/getTaxAmount.js +1 -1
  119. package/dist/cjs/getTipAmount.js +1 -1
  120. package/dist/cjs/hasAmountToPay.js +1 -1
  121. package/dist/cjs/index-C3LUTqjR.js +855 -0
  122. package/dist/cjs/{index-CZ_VFGNj.js.map → index-C3LUTqjR.js.map} +1 -1
  123. package/dist/cjs/index.js +14 -20
  124. package/dist/cjs/index.js.map +1 -1
  125. package/dist/cjs/{queryConstants-Cka1X6GX.js → queryConstants-Dc6wh21D.js} +2 -2
  126. package/dist/cjs/{queryConstants-Cka1X6GX.js.map → queryConstants-Dc6wh21D.js.map} +1 -1
  127. package/dist/cjs/renderFunctions-ghFUoYiM.js +48 -0
  128. package/dist/cjs/renderFunctions-ghFUoYiM.js.map +1 -0
  129. package/dist/cjs/useAccountsApi-Dw9yNiOj.js +42 -0
  130. package/dist/cjs/useAccountsApi-Dw9yNiOj.js.map +1 -0
  131. package/dist/cjs/useIntegrationsApi-B8JBENJ0.js +20 -0
  132. package/dist/cjs/{useIntegrationsApi-BO9PhVVO.js.map → useIntegrationsApi-B8JBENJ0.js.map} +1 -1
  133. package/dist/cjs/usePaymentApi-C034qyn4.js +29 -0
  134. package/dist/cjs/usePaymentApi-C034qyn4.js.map +1 -0
  135. package/dist/cjs/usePaymentApi-Dvv-jkNC.js +44 -0
  136. package/dist/cjs/usePaymentApi-Dvv-jkNC.js.map +1 -0
  137. package/dist/cjs/usePaymentApi-HlugiqX9.js +29 -0
  138. package/dist/cjs/{usePaymentApi-BE8xfY-U.js.map → usePaymentApi-HlugiqX9.js.map} +1 -1
  139. package/dist/cjs/usePlatformApi-DpOqBsBn.js +55 -0
  140. package/dist/cjs/{usePlatformApi-C7lXP6ev.js.map → usePlatformApi-DpOqBsBn.js.map} +1 -1
  141. package/dist/cjs/useRazorpayPayment.js +48 -73
  142. package/dist/cjs/useRazorpayPayment.js.map +1 -1
  143. package/dist/cjs/useStripePromise.js +22 -48
  144. package/dist/cjs/useStripePromise.js.map +1 -1
  145. package/dist/constants.js +1 -1
  146. package/dist/dashboard-CKB3Vyop.js +90 -0
  147. package/dist/dashboard-CKB3Vyop.js.map +1 -0
  148. package/dist/{exportChannel-DAxJ44QB.js → exportChannel-Db0U5gc1.js} +16 -18
  149. package/dist/{exportChannel-DAxJ44QB.js.map → exportChannel-Db0U5gc1.js.map} +1 -1
  150. package/dist/getAddressElementOptions.js +1 -1
  151. package/dist/getAmountInLargestCurrencyUnit.js +1 -1
  152. package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
  153. package/dist/getAmountWithAppliedTax.js +1 -1
  154. package/dist/getFormattedAmount.js +1 -1
  155. package/dist/getFormattedDiscountedAmount.js +1 -1
  156. package/dist/getFormattedDiscountedPercentage.js +1 -1
  157. package/dist/getFormattedTaxAmount.js +1 -1
  158. package/dist/getFormattedTipAmount.js +1 -1
  159. package/dist/getQrCodeValue.js +1 -1
  160. package/dist/getTaxAmount.js +1 -1
  161. package/dist/getTipAmount.js +1 -1
  162. package/dist/hasAmountToPay.js +1 -1
  163. package/dist/index-BTVToZp9.js +804 -0
  164. package/dist/{index-C7irWceQ.js.map → index-BTVToZp9.js.map} +1 -1
  165. package/dist/index.js +14 -20
  166. package/dist/index.js.map +1 -1
  167. package/dist/{queryConstants-DFKKEEo0.js → queryConstants-C7AqdemO.js} +2 -2
  168. package/dist/{queryConstants-DFKKEEo0.js.map → queryConstants-C7AqdemO.js.map} +1 -1
  169. package/dist/renderFunctions-BB3hiqhN.js +44 -0
  170. package/dist/renderFunctions-BB3hiqhN.js.map +1 -0
  171. package/dist/useAccountsApi-C4KOwjWh.js +38 -0
  172. package/dist/useAccountsApi-C4KOwjWh.js.map +1 -0
  173. package/dist/useIntegrationsApi-CDqBFq32.js +18 -0
  174. package/dist/{useIntegrationsApi-D1bkKtoy.js.map → useIntegrationsApi-CDqBFq32.js.map} +1 -1
  175. package/dist/usePaymentApi-B3dzQqWN.js +26 -0
  176. package/dist/usePaymentApi-B3dzQqWN.js.map +1 -0
  177. package/dist/usePaymentApi-DG2ApS6s.js +41 -0
  178. package/dist/usePaymentApi-DG2ApS6s.js.map +1 -0
  179. package/dist/usePaymentApi-_dPcALic.js +27 -0
  180. package/dist/{usePaymentApi-DcMNbOMk.js.map → usePaymentApi-_dPcALic.js.map} +1 -1
  181. package/dist/usePlatformApi-DBLpH3rH.js +50 -0
  182. package/dist/{usePlatformApi-Di7Dg-Gn.js.map → usePlatformApi-DBLpH3rH.js.map} +1 -1
  183. package/dist/useRazorpayPayment.js +48 -73
  184. package/dist/useRazorpayPayment.js.map +1 -1
  185. package/dist/useStripePromise.js +22 -48
  186. package/dist/useStripePromise.js.map +1 -1
  187. package/package.json +12 -11
  188. package/dist/CopyButtonWrapper-rv-OaINx.js.map +0 -1
  189. package/dist/ExportModal-CxKyrlwf.js +0 -120
  190. package/dist/ExportModal-CxKyrlwf.js.map +0 -1
  191. package/dist/cjs/CopyButtonWrapper-BkpN0Wmd.js.map +0 -1
  192. package/dist/cjs/ExportModal-DxCzPCh0.js +0 -122
  193. package/dist/cjs/ExportModal-DxCzPCh0.js.map +0 -1
  194. package/dist/cjs/dashboard-DKHencVn.js +0 -110
  195. package/dist/cjs/dashboard-DKHencVn.js.map +0 -1
  196. package/dist/cjs/index-CZ_VFGNj.js +0 -899
  197. package/dist/cjs/renderFunctions-CX_K4qf8.js +0 -51
  198. package/dist/cjs/renderFunctions-CX_K4qf8.js.map +0 -1
  199. package/dist/cjs/useAccountsApi-DC617yB4.js +0 -62
  200. package/dist/cjs/useAccountsApi-DC617yB4.js.map +0 -1
  201. package/dist/cjs/useIntegrationsApi-BO9PhVVO.js +0 -26
  202. package/dist/cjs/usePaymentApi-BE8xfY-U.js +0 -39
  203. package/dist/cjs/usePaymentApi-C9aQhuda.js +0 -56
  204. package/dist/cjs/usePaymentApi-C9aQhuda.js.map +0 -1
  205. package/dist/cjs/usePaymentApi-CrKom4eT.js +0 -41
  206. package/dist/cjs/usePaymentApi-CrKom4eT.js.map +0 -1
  207. package/dist/cjs/usePlatformApi-C7lXP6ev.js +0 -84
  208. package/dist/dashboard-ClEN2ygs.js +0 -104
  209. package/dist/dashboard-ClEN2ygs.js.map +0 -1
  210. package/dist/index-C7irWceQ.js +0 -848
  211. package/dist/renderFunctions-D9sAy3V_.js +0 -47
  212. package/dist/renderFunctions-D9sAy3V_.js.map +0 -1
  213. package/dist/useAccountsApi-DPem_UA-.js +0 -58
  214. package/dist/useAccountsApi-DPem_UA-.js.map +0 -1
  215. package/dist/useIntegrationsApi-D1bkKtoy.js +0 -24
  216. package/dist/usePaymentApi-BV0jXF-6.js +0 -38
  217. package/dist/usePaymentApi-BV0jXF-6.js.map +0 -1
  218. package/dist/usePaymentApi-DHARy-kC.js +0 -53
  219. package/dist/usePaymentApi-DHARy-kC.js.map +0 -1
  220. package/dist/usePaymentApi-DcMNbOMk.js +0 -37
  221. package/dist/usePlatformApi-Di7Dg-Gn.js +0 -79
@@ -1,93 +1,74 @@
1
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
3
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
1
  import { useState, startTransition, useEffect } from 'react';
5
2
  import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from 'neetocommons/constants';
6
3
  import { currencyFormat, getQueryParams, buildUrl } from 'neetocommons/utils';
7
4
  import { Bar, buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend';
8
- import { Modal, Typography, Tooltip, Tag, Pane, Spinner, Button, NoData, Table, Dropdown, Tab } from '@bigbinary/neetoui';
5
+ import { Modal, Typography, Tooltip, Tag, Pane, Spinner, Button, NoData, Table, Tab, Dropdown } from '@bigbinary/neetoui';
9
6
  import { mergeLeft, curry, mergeDeepWith, concat, reject, isNil, map, prop, sortBy, isEmpty, modify, pluck } from 'ramda';
10
7
  import { useHistory } from 'react-router-dom';
11
- import { E as ExportModal } from './ExportModal-CxKyrlwf.js';
8
+ import { E as ExportModal } from './ExportModal-CoRuQVas.js';
12
9
  import { useQuery } from '@tanstack/react-query';
13
10
  import { useMutationWithInvalidation } from 'neetocommons/react-utils';
14
11
  import axios from 'axios';
15
- import { B as BASE_URL, v as preProcessStatus, w as getTagStyle, l as formatAmount, m as formatCurrency, x as PAYMENT_KIND, S as SORT_DIRECTIONS, p as processDataIndex, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, i as DEFAULT_PAGE_VALUES, q as DASHBOARD_KIND } from './index-C7irWceQ.js';
16
- import { Q as QUERY_KEYS } from './queryConstants-DFKKEEo0.js';
12
+ import { B as BASE_URL, v as preProcessStatus, w as getTagStyle, l as formatAmount, m as formatCurrency, x as PAYMENT_KIND, S as SORT_DIRECTIONS, p as processDataIndex, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, i as DEFAULT_PAGE_VALUES, q as DASHBOARD_KIND } from './index-BTVToZp9.js';
13
+ import { Q as QUERY_KEYS } from './queryConstants-C7AqdemO.js';
17
14
  import { Form, Textarea, ActionBlock } from '@bigbinary/neetoui/formik';
18
15
  import { useTranslation, Trans } from 'react-i18next';
19
16
  import { t } from 'i18next';
20
17
  import * as yup from 'yup';
18
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
21
19
  import { isNotPresent, humanize, isPresent, removeBy, camelToSnakeCase, isNotEmpty, existsBy } from 'neetocist';
22
20
  import { useTableConfigurations } from '@bigbinary/neeto-molecules/Columns';
23
21
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
24
- import { T as TABLE_KEYS } from './exportChannel-DAxJ44QB.js';
22
+ import { T as TABLE_KEYS } from './exportChannel-Db0U5gc1.js';
25
23
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
26
24
  import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
27
- import { C as CopyButtonWrapper } from './CopyButtonWrapper-rv-OaINx.js';
25
+ import { C as CopyButtonWrapper } from './CopyButtonWrapper-Bp5IVO76.js';
28
26
  import Header from '@bigbinary/neeto-molecules/Header';
29
27
  import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
30
28
  import '@bigbinary/neeto-icons';
31
29
  import 'decimal.js';
32
30
  import '@bigbinary/neeto-molecules/CopyToClipboardButton';
33
31
 
34
- var list = function list(payload) {
35
- return axios.get("".concat(BASE_URL, "/api/v1/split_transfers"), {
36
- params: payload
37
- });
38
- };
39
- var show = function show(id) {
40
- return axios.get("".concat(BASE_URL, "/api/v1/split_transfers/").concat(id));
41
- };
42
- var bulkUpdate = function bulkUpdate(payload) {
43
- return axios.post("".concat(BASE_URL, "/api/v1/split_transfers/bulk_update"), {
44
- splitTransfer: payload
45
- });
46
- };
47
- var splitTransfersApi = {
48
- list: list,
49
- show: show,
50
- bulkUpdate: bulkUpdate
32
+ const list = payload => axios.get(`${BASE_URL}/api/v1/split_transfers`, {
33
+ params: payload
34
+ });
35
+ const show = id => axios.get(`${BASE_URL}/api/v1/split_transfers/${id}`);
36
+ const bulkUpdate = payload => axios.post(`${BASE_URL}/api/v1/split_transfers/bulk_update`, {
37
+ splitTransfer: payload
38
+ });
39
+ const splitTransfersApi = {
40
+ list,
41
+ show,
42
+ bulkUpdate
51
43
  };
52
44
 
53
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
54
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
55
- var useFetchSplitTransfers = function useFetchSplitTransfers() {
56
- var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
57
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
58
- return useQuery(_objectSpread$2({
59
- queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_LIST, payload],
60
- queryFn: function queryFn() {
61
- return splitTransfersApi.list(payload);
62
- }
63
- }, options));
64
- };
65
- var useShowSplitTransfers = function useShowSplitTransfers(id, options) {
66
- return useQuery(_objectSpread$2({
67
- queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_DETAILS, id],
68
- queryFn: function queryFn() {
69
- return splitTransfersApi.show(id);
70
- }
71
- }, options));
72
- };
73
- var useBulkUpdateSplitTransfers = function useBulkUpdateSplitTransfers(options) {
74
- return useMutationWithInvalidation(splitTransfersApi.bulkUpdate, _objectSpread$2({
75
- keysToInvalidate: [QUERY_KEYS.SPLIT_TRANSFERS_LISTw]
76
- }, options));
77
- };
45
+ const useFetchSplitTransfers = (payload = {}, options = {}) => useQuery({
46
+ queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_LIST, payload],
47
+ queryFn: () => splitTransfersApi.list(payload),
48
+ ...options
49
+ });
50
+ const useShowSplitTransfers = (id, options) => useQuery({
51
+ queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_DETAILS, id],
52
+ queryFn: () => splitTransfersApi.show(id),
53
+ ...options
54
+ });
55
+ const useBulkUpdateSplitTransfers = options => useMutationWithInvalidation(splitTransfersApi.bulkUpdate, {
56
+ keysToInvalidate: [QUERY_KEYS.SPLIT_TRANSFERS_LISTw],
57
+ ...options
58
+ });
78
59
 
79
- var SPLIT_TRANSFERS_DASHBOARD_TAB = {
60
+ const SPLIT_TRANSFERS_DASHBOARD_TAB = {
80
61
  all: "all",
81
62
  successful: "successful",
82
63
  cancelled: "cancelled",
83
64
  pending: "pending"
84
65
  };
85
- var SEARCH_PROPS = {
66
+ const SEARCH_PROPS = {
86
67
  node: "identifier,",
87
68
  key: "search_term",
88
69
  model: "NeetoPaymentsEngine::Payments::Split,"
89
70
  };
90
- var FILTER_COLUMNS = [{
71
+ const FILTER_COLUMNS = [{
91
72
  key: "amount",
92
73
  label: t("neetoPayments.common.amount"),
93
74
  node: "amount",
@@ -98,905 +79,963 @@ var FILTER_COLUMNS = [{
98
79
  node: "payment_at",
99
80
  type: "date"
100
81
  }];
101
- var INITIAL_TRANSFER_DETAILS = {
82
+ const INITIAL_TRANSFER_DETAILS = {
102
83
  id: null,
103
84
  isPaneOpen: false
104
85
  };
105
- var VALIDATION_SCHEMA = yup.object().shape({
86
+ const VALIDATION_SCHEMA = yup.object().shape({
106
87
  reason: yup.string().required(t("neetoPayments.cancelSplitTransfers.reasonRequired"))
107
88
  });
108
89
 
109
- var CancelModal = function CancelModal(_ref) {
110
- var isOpen = _ref.isOpen,
111
- onClose = _ref.onClose,
112
- handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
113
- var _useTranslation = useTranslation(),
114
- t = _useTranslation.t;
115
- var handleSubmit = function handleSubmit(_ref2) {
116
- var reason = _ref2.reason;
90
+ const CancelModal = ({
91
+ isOpen,
92
+ onClose,
93
+ handleSplitTransfersUpdate
94
+ }) => {
95
+ const {
96
+ t
97
+ } = useTranslation();
98
+ const handleSubmit = ({
99
+ reason
100
+ }) => {
117
101
  handleSplitTransfersUpdate("cancelled", reason);
118
102
  };
119
- return /*#__PURE__*/React.createElement(Modal, {
120
- isOpen: isOpen,
121
- onClose: onClose,
122
- size: "large"
123
- }, /*#__PURE__*/React.createElement(Modal.Header, null, /*#__PURE__*/React.createElement(Typography, {
124
- style: "h2",
125
- weight: "medium"
126
- }, t("neetoPayments.cancelSplitTransfers.modal.title"))), /*#__PURE__*/React.createElement(Form, {
127
- formikProps: {
128
- initialValues: {
129
- reason: ""
103
+ return /*#__PURE__*/jsxs(Modal, {
104
+ isOpen,
105
+ onClose,
106
+ size: "large",
107
+ children: [/*#__PURE__*/jsx(Modal.Header, {
108
+ children: /*#__PURE__*/jsx(Typography, {
109
+ style: "h2",
110
+ weight: "medium",
111
+ children: t("neetoPayments.cancelSplitTransfers.modal.title")
112
+ })
113
+ }), /*#__PURE__*/jsx(Form, {
114
+ formikProps: {
115
+ initialValues: {
116
+ reason: ""
117
+ },
118
+ validationSchema: VALIDATION_SCHEMA,
119
+ onSubmit: handleSubmit
130
120
  },
131
- validationSchema: VALIDATION_SCHEMA,
132
- onSubmit: handleSubmit
133
- }
134
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal.Body, null, /*#__PURE__*/React.createElement("div", {
135
- className: "flex flex-col space-y-4"
136
- }, /*#__PURE__*/React.createElement(Textarea, {
137
- required: true,
138
- label: t("neetoPayments.cancelSplitTransfers.modal.reason"),
139
- name: "reason"
140
- }))), /*#__PURE__*/React.createElement(Modal.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
141
- position: "right",
142
- cancelButtonProps: {
143
- onClick: onClose,
144
- style: "tertiary"
145
- },
146
- submitButtonProps: {
147
- disabled: false,
148
- label: t("neetoPayments.common.submit")
149
- }
150
- })))));
121
+ children: /*#__PURE__*/jsxs(Fragment, {
122
+ children: [/*#__PURE__*/jsx(Modal.Body, {
123
+ children: /*#__PURE__*/jsx("div", {
124
+ className: "flex flex-col space-y-4",
125
+ children: /*#__PURE__*/jsx(Textarea, {
126
+ required: true,
127
+ label: t("neetoPayments.cancelSplitTransfers.modal.reason"),
128
+ name: "reason"
129
+ })
130
+ })
131
+ }), /*#__PURE__*/jsx(Modal.Footer, {
132
+ children: /*#__PURE__*/jsx(ActionBlock, {
133
+ position: "right",
134
+ cancelButtonProps: {
135
+ onClick: onClose,
136
+ style: "tertiary"
137
+ },
138
+ submitButtonProps: {
139
+ disabled: false,
140
+ label: t("neetoPayments.common.submit")
141
+ }
142
+ })
143
+ })]
144
+ })
145
+ })]
146
+ });
151
147
  };
152
148
 
153
- var Status = function Status(_ref) {
154
- var type = _ref.type,
155
- _ref$status = _ref.status,
156
- status = _ref$status === void 0 ? "" : _ref$status;
157
- var _useTranslation = useTranslation(),
158
- t = _useTranslation.t;
159
- var processedStatus = preProcessStatus(type, status);
149
+ const Status = ({
150
+ type,
151
+ status = ""
152
+ }) => {
153
+ const {
154
+ t
155
+ } = useTranslation();
156
+ const processedStatus = preProcessStatus(type, status);
160
157
  if (isNotPresent(status)) {
161
- return /*#__PURE__*/React.createElement(Typography, {
162
- style: "body2"
163
- }, t("neetoPayments.common.notAvailable"));
158
+ return /*#__PURE__*/jsx(Typography, {
159
+ style: "body2",
160
+ children: t("neetoPayments.common.notAvailable")
161
+ });
164
162
  }
165
- return /*#__PURE__*/React.createElement(Tooltip, {
166
- content: t("neetoPayments.tooltipContent.".concat(type, ".").concat(processedStatus)),
167
- position: "top"
168
- }, /*#__PURE__*/React.createElement("div", {
169
- className: "w-fit"
170
- }, /*#__PURE__*/React.createElement(Tag, {
171
- style: getTagStyle(processedStatus),
172
- label: humanize(t("neetoPayments.tagLabels.".concat(type, ".").concat(processedStatus)))
173
- })));
163
+ return /*#__PURE__*/jsx(Tooltip, {
164
+ content: t(`neetoPayments.tooltipContent.${type}.${processedStatus}`),
165
+ position: "top",
166
+ children: /*#__PURE__*/jsx("div", {
167
+ className: "w-fit",
168
+ children: /*#__PURE__*/jsx(Tag, {
169
+ style: getTagStyle(processedStatus),
170
+ label: humanize(t(`neetoPayments.tagLabels.${type}.${processedStatus}`))
171
+ })
172
+ })
173
+ });
174
174
  };
175
175
 
176
- var Date = function Date(_ref) {
177
- var date = _ref.date,
178
- _ref$isTimeVisible = _ref.isTimeVisible,
179
- isTimeVisible = _ref$isTimeVisible === void 0 ? false : _ref$isTimeVisible;
180
- var _useTranslation = useTranslation(),
181
- t = _useTranslation.t;
176
+ const Date = ({
177
+ date,
178
+ isTimeVisible = false
179
+ }) => {
180
+ const {
181
+ t
182
+ } = useTranslation();
182
183
  if (isNotPresent(date)) {
183
- return /*#__PURE__*/React.createElement(Typography, {
184
- style: "body2"
185
- }, t("neetoPayments.common.notAvailable"));
184
+ return /*#__PURE__*/jsx(Typography, {
185
+ style: "body2",
186
+ children: t("neetoPayments.common.notAvailable")
187
+ });
186
188
  }
187
189
  if (isTimeVisible) {
188
- return /*#__PURE__*/React.createElement("div", {
189
- className: "flex items-center"
190
- }, /*#__PURE__*/React.createElement(DateFormat.DateTime, {
191
- date: date
192
- }));
190
+ return /*#__PURE__*/jsx("div", {
191
+ className: "flex items-center",
192
+ children: /*#__PURE__*/jsx(DateFormat.DateTime, {
193
+ date
194
+ })
195
+ });
193
196
  }
194
- return /*#__PURE__*/React.createElement("div", {
195
- className: "flex items-center"
196
- }, /*#__PURE__*/React.createElement(DateFormat.Date, {
197
- date: date
198
- }));
197
+ return /*#__PURE__*/jsx("div", {
198
+ className: "flex items-center",
199
+ children: /*#__PURE__*/jsx(DateFormat.Date, {
200
+ date
201
+ })
202
+ });
199
203
  };
200
204
 
201
- var DiscountCode = function DiscountCode(_ref) {
202
- var discountCode = _ref.discountCode,
203
- currency = _ref.currency;
204
- var _useTranslation = useTranslation(),
205
- t = _useTranslation.t;
206
- var code = discountCode.code,
207
- value = discountCode.value,
208
- kind = discountCode.kind;
209
- return /*#__PURE__*/React.createElement(Typography, {
210
- style: "body2"
211
- }, kind === "percentage" ? t("neetoPayments.splitTransferDetails.discountCodeOfPercentageApplied", {
212
- code: code,
213
- percentage: value.toFixed(1)
214
- }) : t("neetoPayments.splitTransferDetails.discountCodeOfAmountApplied", {
215
- code: code,
216
- amount: currencyFormat.withSymbol(value, currency.toUpperCase(), {
217
- maximumFractionDigits: 2,
218
- minimumFractionDigits: 2
205
+ const DiscountCode = ({
206
+ discountCode,
207
+ currency
208
+ }) => {
209
+ const {
210
+ t
211
+ } = useTranslation();
212
+ const {
213
+ code,
214
+ value,
215
+ kind
216
+ } = discountCode;
217
+ return /*#__PURE__*/jsx(Typography, {
218
+ style: "body2",
219
+ children: kind === "percentage" ? t("neetoPayments.splitTransferDetails.discountCodeOfPercentageApplied", {
220
+ code,
221
+ percentage: value.toFixed(1)
222
+ }) : t("neetoPayments.splitTransferDetails.discountCodeOfAmountApplied", {
223
+ code,
224
+ amount: currencyFormat.withSymbol(value, currency.toUpperCase(), {
225
+ maximumFractionDigits: 2,
226
+ minimumFractionDigits: 2
227
+ })
219
228
  })
220
- }));
229
+ });
221
230
  };
222
231
 
223
- var Details = function Details(_ref) {
224
- var _splitTransfer$source, _splitTransfer$curren, _splitTransfer$source2, _splitTransfer$curren2, _splitTransfer$curren3, _splitTransfer$curren4, _splitTransfer$destin, _splitTransfer$destin2, _splitTransfer$destin3;
225
- var selectedTransfer = _ref.selectedTransfer,
226
- setSelectedTransfer = _ref.setSelectedTransfer;
227
- var _useTranslation = useTranslation(),
228
- t = _useTranslation.t;
229
- var _useShowSplitTransfer = useShowSplitTransfers(selectedTransfer["id"], {
230
- enabled: isPresent(selectedTransfer["id"])
231
- }),
232
- isPending = _useShowSplitTransfer.isPending,
233
- _useShowSplitTransfer2 = _useShowSplitTransfer.data,
234
- _useShowSplitTransfer3 = _useShowSplitTransfer2 === void 0 ? {} : _useShowSplitTransfer2,
235
- splitTransfer = _useShowSplitTransfer3.splitTransfer;
236
- return /*#__PURE__*/React.createElement(Pane, {
232
+ const Details = ({
233
+ selectedTransfer,
234
+ setSelectedTransfer
235
+ }) => {
236
+ const {
237
+ t
238
+ } = useTranslation();
239
+ const {
240
+ isPending,
241
+ data: {
242
+ splitTransfer
243
+ } = {}
244
+ } = useShowSplitTransfers(selectedTransfer["id"], {
245
+ enabled: isPresent(selectedTransfer["id"])
246
+ });
247
+ return /*#__PURE__*/jsxs(Pane, {
237
248
  isOpen: selectedTransfer["isPaneOpen"],
238
249
  size: "large",
239
- onClose: function onClose() {
240
- return setSelectedTransfer(mergeLeft({
241
- isPaneOpen: false
242
- }, selectedTransfer));
243
- }
244
- }, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
245
- style: "h2"
246
- }, t("neetoPayments.splitTransferDetails.title"))), /*#__PURE__*/React.createElement(Pane.Body, null, isPending ? /*#__PURE__*/React.createElement("div", {
247
- className: "flex h-full w-full items-center justify-center"
248
- }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement("div", {
249
- className: "space-y-4 p-3"
250
- }, /*#__PURE__*/React.createElement("div", {
251
- className: "flex grid-cols-2 flex-col gap-3 lg:grid"
252
- }, /*#__PURE__*/React.createElement(Typography, {
253
- style: "body1",
254
- weight: "medium"
255
- }, t("neetoPayments.common.identifier")), /*#__PURE__*/React.createElement(Button, {
256
- href: splitTransfer.transferUrl,
257
- label: splitTransfer.identifier,
258
- size: "small",
259
- style: "link",
260
- target: "_blank"
261
- }), /*#__PURE__*/React.createElement(Typography, {
262
- style: "body1",
263
- weight: "medium"
264
- }, t("neetoPayments.common.status")), /*#__PURE__*/React.createElement(Status, {
265
- status: splitTransfer.status,
266
- type: "splitTransfers"
267
- }), /*#__PURE__*/React.createElement(Typography, {
268
- style: "body1",
269
- weight: "medium"
270
- }, t("neetoPayments.common.transferTime")), /*#__PURE__*/React.createElement(Date, {
271
- isTimeVisible: true,
272
- date: splitTransfer.paymentAt
273
- }), /*#__PURE__*/React.createElement(Typography, {
274
- style: "body1",
275
- weight: "medium"
276
- }, t("neetoPayments.common.paymentAmount")), /*#__PURE__*/React.createElement(Typography, {
277
- style: "body2"
278
- }, currencyFormat.withCode((_splitTransfer$source = splitTransfer.sourcePayment) === null || _splitTransfer$source === void 0 ? void 0 : _splitTransfer$source.amount, (_splitTransfer$curren = splitTransfer.currency) === null || _splitTransfer$curren === void 0 ? void 0 : _splitTransfer$curren.toUpperCase())), isPresent(splitTransfer.discountCode) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
279
- style: "body1",
280
- weight: "medium"
281
- }, t("neetoPayments.common.discountCode")), /*#__PURE__*/React.createElement(DiscountCode, {
282
- currency: splitTransfer.currency,
283
- discountCode: splitTransfer.discountCode
284
- })), /*#__PURE__*/React.createElement("div", {
285
- className: "flex items-center space-x-1"
286
- }, /*#__PURE__*/React.createElement(Typography, {
287
- style: "body1",
288
- weight: "medium"
289
- }, t("neetoPayments.common.netAmount")), /*#__PURE__*/React.createElement(HelpPopover, {
290
- popoverProps: {
291
- position: "right"
292
- },
293
- description: t("neetoPayments.splitTransferDetails.netAmountDescription"),
294
- title: t("neetoPayments.splitTransferDetails.netAmountHelpTitle")
295
- })), /*#__PURE__*/React.createElement(Typography, {
296
- style: "body2"
297
- }, currencyFormat.withCode((_splitTransfer$source2 = splitTransfer.sourcePayment) === null || _splitTransfer$source2 === void 0 ? void 0 : _splitTransfer$source2.netAmount, (_splitTransfer$curren2 = splitTransfer.currency) === null || _splitTransfer$curren2 === void 0 ? void 0 : _splitTransfer$curren2.toUpperCase())), /*#__PURE__*/React.createElement("div", {
298
- className: "flex space-x-1"
299
- }, /*#__PURE__*/React.createElement(Typography, {
300
- style: "body1",
301
- weight: "medium"
302
- }, t("neetoPayments.common.platformShare")), /*#__PURE__*/React.createElement(HelpPopover, {
303
- popoverProps: {
304
- position: "right"
305
- },
306
- description: t("neetoPayments.splitTransferDetails.platformShareDescription"),
307
- title: t("neetoPayments.splitTransferDetails.platformShareHelpTitle")
308
- })), /*#__PURE__*/React.createElement(Typography, {
309
- style: "body2"
310
- }, currencyFormat.withCode(splitTransfer.platformShare, (_splitTransfer$curren3 = splitTransfer.currency) === null || _splitTransfer$curren3 === void 0 ? void 0 : _splitTransfer$curren3.toUpperCase())), /*#__PURE__*/React.createElement(Typography, {
311
- style: "body1",
312
- weight: "medium"
313
- }, t("neetoPayments.common.transferredAmount")), /*#__PURE__*/React.createElement(Typography, {
314
- style: "body2"
315
- }, currencyFormat.withCode(splitTransfer.amount, (_splitTransfer$curren4 = splitTransfer.currency) === null || _splitTransfer$curren4 === void 0 ? void 0 : _splitTransfer$curren4.toUpperCase()))), /*#__PURE__*/React.createElement(Typography, {
316
- style: "h3"
317
- }, t("neetoPayments.splitTransferDetails.destinationDetails")), /*#__PURE__*/React.createElement("div", {
318
- className: "flex grid-cols-2 flex-col gap-3 lg:grid"
319
- }, /*#__PURE__*/React.createElement(Typography, {
320
- style: "body1",
321
- weight: "medium"
322
- }, t("neetoPayments.common.destinationAccountIdentifier")), /*#__PURE__*/React.createElement(Button, {
323
- href: splitTransfer.destinationAccount.dashboardUrl,
324
- label: splitTransfer.destinationAccount.identifier,
325
- size: "small",
326
- style: "link",
327
- target: "_blank"
328
- }), /*#__PURE__*/React.createElement(Typography, {
329
- style: "body1",
330
- weight: "medium"
331
- }, t("neetoPayments.common.destinationAccountName")), /*#__PURE__*/React.createElement(Typography, {
332
- style: "body2"
333
- }, splitTransfer.destinationAccount.userName), /*#__PURE__*/React.createElement(Typography, {
334
- style: "body1",
335
- weight: "medium"
336
- }, t("neetoPayments.common.destinationAccountEmail")), /*#__PURE__*/React.createElement(Typography, {
337
- style: "body2"
338
- }, splitTransfer.destinationAccount.userEmail), /*#__PURE__*/React.createElement(Typography, {
339
- style: "body1",
340
- weight: "medium"
341
- }, t("neetoPayments.common.payoutStatus")), /*#__PURE__*/React.createElement(Status, {
342
- status: (_splitTransfer$destin = splitTransfer.destinationPayout) === null || _splitTransfer$destin === void 0 ? void 0 : _splitTransfer$destin.status,
343
- type: "payout"
344
- }), /*#__PURE__*/React.createElement(Typography, {
345
- style: "body1",
346
- weight: "medium"
347
- }, t("neetoPayments.splitTransferDetails.payoutInitiatedDate")), /*#__PURE__*/React.createElement(Date, {
348
- date: (_splitTransfer$destin2 = splitTransfer.destinationPayout) === null || _splitTransfer$destin2 === void 0 ? void 0 : _splitTransfer$destin2.createdAt
349
- }), /*#__PURE__*/React.createElement(Typography, {
350
- style: "body1",
351
- weight: "medium"
352
- }, t("neetoPayments.splitTransferDetails.payoutArrivalDate")), /*#__PURE__*/React.createElement(Date, {
353
- date: (_splitTransfer$destin3 = splitTransfer.destinationPayout) === null || _splitTransfer$destin3 === void 0 ? void 0 : _splitTransfer$destin3.arrivalDate
354
- }), /*#__PURE__*/React.createElement("div", null)))));
250
+ onClose: () => setSelectedTransfer(mergeLeft({
251
+ isPaneOpen: false
252
+ }, selectedTransfer)),
253
+ children: [/*#__PURE__*/jsx(Pane.Header, {
254
+ children: /*#__PURE__*/jsx(Typography, {
255
+ style: "h2",
256
+ children: t("neetoPayments.splitTransferDetails.title")
257
+ })
258
+ }), /*#__PURE__*/jsx(Pane.Body, {
259
+ children: isPending ? /*#__PURE__*/jsx("div", {
260
+ className: "flex h-full w-full items-center justify-center",
261
+ children: /*#__PURE__*/jsx(Spinner, {})
262
+ }) : /*#__PURE__*/jsxs("div", {
263
+ className: "space-y-4 p-3",
264
+ children: [/*#__PURE__*/jsxs("div", {
265
+ className: "flex grid-cols-2 flex-col gap-3 lg:grid",
266
+ children: [/*#__PURE__*/jsx(Typography, {
267
+ style: "body1",
268
+ weight: "medium",
269
+ children: t("neetoPayments.common.identifier")
270
+ }), /*#__PURE__*/jsx(Button, {
271
+ href: splitTransfer.transferUrl,
272
+ label: splitTransfer.identifier,
273
+ size: "small",
274
+ style: "link",
275
+ target: "_blank"
276
+ }), /*#__PURE__*/jsx(Typography, {
277
+ style: "body1",
278
+ weight: "medium",
279
+ children: t("neetoPayments.common.status")
280
+ }), /*#__PURE__*/jsx(Status, {
281
+ status: splitTransfer.status,
282
+ type: "splitTransfers"
283
+ }), /*#__PURE__*/jsx(Typography, {
284
+ style: "body1",
285
+ weight: "medium",
286
+ children: t("neetoPayments.common.transferTime")
287
+ }), /*#__PURE__*/jsx(Date, {
288
+ isTimeVisible: true,
289
+ date: splitTransfer.paymentAt
290
+ }), /*#__PURE__*/jsx(Typography, {
291
+ style: "body1",
292
+ weight: "medium",
293
+ children: t("neetoPayments.common.paymentAmount")
294
+ }), /*#__PURE__*/jsx(Typography, {
295
+ style: "body2",
296
+ children: currencyFormat.withCode(splitTransfer.sourcePayment?.amount, splitTransfer.currency?.toUpperCase())
297
+ }), isPresent(splitTransfer.discountCode) && /*#__PURE__*/jsxs(Fragment, {
298
+ children: [/*#__PURE__*/jsx(Typography, {
299
+ style: "body1",
300
+ weight: "medium",
301
+ children: t("neetoPayments.common.discountCode")
302
+ }), /*#__PURE__*/jsx(DiscountCode, {
303
+ currency: splitTransfer.currency,
304
+ discountCode: splitTransfer.discountCode
305
+ })]
306
+ }), /*#__PURE__*/jsxs("div", {
307
+ className: "flex items-center space-x-1",
308
+ children: [/*#__PURE__*/jsx(Typography, {
309
+ style: "body1",
310
+ weight: "medium",
311
+ children: t("neetoPayments.common.netAmount")
312
+ }), /*#__PURE__*/jsx(HelpPopover, {
313
+ popoverProps: {
314
+ position: "right"
315
+ },
316
+ description: t("neetoPayments.splitTransferDetails.netAmountDescription"),
317
+ title: t("neetoPayments.splitTransferDetails.netAmountHelpTitle")
318
+ })]
319
+ }), /*#__PURE__*/jsx(Typography, {
320
+ style: "body2",
321
+ children: currencyFormat.withCode(splitTransfer.sourcePayment?.netAmount, splitTransfer.currency?.toUpperCase())
322
+ }), /*#__PURE__*/jsxs("div", {
323
+ className: "flex space-x-1",
324
+ children: [/*#__PURE__*/jsx(Typography, {
325
+ style: "body1",
326
+ weight: "medium",
327
+ children: t("neetoPayments.common.platformShare")
328
+ }), /*#__PURE__*/jsx(HelpPopover, {
329
+ popoverProps: {
330
+ position: "right"
331
+ },
332
+ description: t("neetoPayments.splitTransferDetails.platformShareDescription"),
333
+ title: t("neetoPayments.splitTransferDetails.platformShareHelpTitle")
334
+ })]
335
+ }), /*#__PURE__*/jsx(Typography, {
336
+ style: "body2",
337
+ children: currencyFormat.withCode(splitTransfer.platformShare, splitTransfer.currency?.toUpperCase())
338
+ }), /*#__PURE__*/jsx(Typography, {
339
+ style: "body1",
340
+ weight: "medium",
341
+ children: t("neetoPayments.common.transferredAmount")
342
+ }), /*#__PURE__*/jsx(Typography, {
343
+ style: "body2",
344
+ children: currencyFormat.withCode(splitTransfer.amount, splitTransfer.currency?.toUpperCase())
345
+ })]
346
+ }), /*#__PURE__*/jsx(Typography, {
347
+ style: "h3",
348
+ children: t("neetoPayments.splitTransferDetails.destinationDetails")
349
+ }), /*#__PURE__*/jsxs("div", {
350
+ className: "flex grid-cols-2 flex-col gap-3 lg:grid",
351
+ children: [/*#__PURE__*/jsx(Typography, {
352
+ style: "body1",
353
+ weight: "medium",
354
+ children: t("neetoPayments.common.destinationAccountIdentifier")
355
+ }), /*#__PURE__*/jsx(Button, {
356
+ href: splitTransfer.destinationAccount.dashboardUrl,
357
+ label: splitTransfer.destinationAccount.identifier,
358
+ size: "small",
359
+ style: "link",
360
+ target: "_blank"
361
+ }), /*#__PURE__*/jsx(Typography, {
362
+ style: "body1",
363
+ weight: "medium",
364
+ children: t("neetoPayments.common.destinationAccountName")
365
+ }), /*#__PURE__*/jsx(Typography, {
366
+ style: "body2",
367
+ children: splitTransfer.destinationAccount.userName
368
+ }), /*#__PURE__*/jsx(Typography, {
369
+ style: "body1",
370
+ weight: "medium",
371
+ children: t("neetoPayments.common.destinationAccountEmail")
372
+ }), /*#__PURE__*/jsx(Typography, {
373
+ style: "body2",
374
+ children: splitTransfer.destinationAccount.userEmail
375
+ }), /*#__PURE__*/jsx(Typography, {
376
+ style: "body1",
377
+ weight: "medium",
378
+ children: t("neetoPayments.common.payoutStatus")
379
+ }), /*#__PURE__*/jsx(Status, {
380
+ status: splitTransfer.destinationPayout?.status,
381
+ type: "payout"
382
+ }), /*#__PURE__*/jsx(Typography, {
383
+ style: "body1",
384
+ weight: "medium",
385
+ children: t("neetoPayments.splitTransferDetails.payoutInitiatedDate")
386
+ }), /*#__PURE__*/jsx(Date, {
387
+ date: splitTransfer.destinationPayout?.createdAt
388
+ }), /*#__PURE__*/jsx(Typography, {
389
+ style: "body1",
390
+ weight: "medium",
391
+ children: t("neetoPayments.splitTransferDetails.payoutArrivalDate")
392
+ }), /*#__PURE__*/jsx(Date, {
393
+ date: splitTransfer.destinationPayout?.arrivalDate
394
+ }), /*#__PURE__*/jsx("div", {})]
395
+ })]
396
+ })
397
+ })]
398
+ });
355
399
  };
356
400
 
357
- var renderIdentifier = curry(function (setSelectedTransfer, identifier, _ref) {
358
- var id = _ref.id;
401
+ const renderIdentifier = curry((setSelectedTransfer, identifier, {
402
+ id
403
+ }) => {
359
404
  if (isNotPresent(identifier)) {
360
- return /*#__PURE__*/React.createElement(Tooltip, {
405
+ return /*#__PURE__*/jsx(Tooltip, {
361
406
  content: t("neetoPayments.tooltipContent.identifierUnavailable"),
362
- position: "top"
363
- }, /*#__PURE__*/React.createElement("div", {
364
- className: "text-center"
365
- }, /*#__PURE__*/React.createElement(Typography, {
366
- style: "body2"
367
- }, t("neetoPayments.common.notAvailable"))));
407
+ position: "top",
408
+ children: /*#__PURE__*/jsx("div", {
409
+ className: "text-center",
410
+ children: /*#__PURE__*/jsx(Typography, {
411
+ style: "body2",
412
+ children: t("neetoPayments.common.notAvailable")
413
+ })
414
+ })
415
+ });
368
416
  }
369
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, {
370
- content: identifier
371
- }, /*#__PURE__*/React.createElement(Button, {
372
- label: identifier,
373
- size: "small",
374
- style: "link",
375
- onClick: function onClick() {
376
- return setSelectedTransfer({
377
- id: id,
417
+ return /*#__PURE__*/jsx(CopyButtonWrapper, {
418
+ content: identifier,
419
+ children: /*#__PURE__*/jsx(Button, {
420
+ label: identifier,
421
+ size: "small",
422
+ style: "link",
423
+ onClick: () => setSelectedTransfer({
424
+ id,
378
425
  isPaneOpen: true
379
- });
380
- }
381
- }));
426
+ })
427
+ })
428
+ });
382
429
  });
383
- var renderPlatformPaymentIdentifier = function renderPlatformPaymentIdentifier(_ref2) {
384
- var identifier = _ref2.identifier,
385
- receiptUrl = _ref2.receiptUrl,
386
- kind = _ref2.kind;
430
+ const renderPlatformPaymentIdentifier = ({
431
+ identifier,
432
+ receiptUrl,
433
+ kind
434
+ }) => {
387
435
  if (kind === PAYMENT_KIND.temporary) {
388
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, {
389
- content: identifier
390
- }, identifier);
436
+ return /*#__PURE__*/jsx(CopyButtonWrapper, {
437
+ content: identifier,
438
+ children: identifier
439
+ });
391
440
  }
392
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, {
393
- content: identifier
394
- }, /*#__PURE__*/React.createElement(Button, {
395
- href: receiptUrl,
396
- label: identifier,
397
- size: "small",
398
- style: "link",
399
- target: "_blank"
400
- }));
441
+ return /*#__PURE__*/jsx(CopyButtonWrapper, {
442
+ content: identifier,
443
+ children: /*#__PURE__*/jsx(Button, {
444
+ href: receiptUrl,
445
+ label: identifier,
446
+ size: "small",
447
+ style: "link",
448
+ target: "_blank"
449
+ })
450
+ });
401
451
  };
402
- var renderDestinationAccountIdentifier = function renderDestinationAccountIdentifier(_ref3) {
403
- var identifier = _ref3.identifier,
404
- dashboardUrl = _ref3.dashboardUrl;
405
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, {
406
- content: identifier
407
- }, /*#__PURE__*/React.createElement(Button, {
452
+ const renderDestinationAccountIdentifier = ({
453
+ identifier,
454
+ dashboardUrl
455
+ }) => /*#__PURE__*/jsx(CopyButtonWrapper, {
456
+ content: identifier,
457
+ children: /*#__PURE__*/jsx(Button, {
408
458
  href: dashboardUrl,
409
459
  label: identifier,
410
460
  size: "small",
411
461
  style: "link",
412
462
  target: "_blank"
413
- }));
414
- };
415
- var renderStatus = curry(function (type, status) {
416
- return /*#__PURE__*/React.createElement(Status, {
417
- status: status,
418
- type: type
419
- });
463
+ })
420
464
  });
421
- var renderDate = function renderDate(date) {
465
+ const renderStatus = curry((type, status) => /*#__PURE__*/jsx(Status, {
466
+ status,
467
+ type
468
+ }));
469
+ const renderDate = date => {
422
470
  if (isNotPresent(date)) {
423
- return /*#__PURE__*/React.createElement(Tooltip, {
471
+ return /*#__PURE__*/jsx(Tooltip, {
424
472
  content: t("neetoPayments.tooltipContent.dateUnavailable"),
425
- position: "top"
426
- }, /*#__PURE__*/React.createElement("div", {
427
- className: "text-center"
428
- }, /*#__PURE__*/React.createElement(Typography, {
429
- style: "body2"
430
- }, t("neetoPayments.common.notAvailable"))));
473
+ position: "top",
474
+ children: /*#__PURE__*/jsx("div", {
475
+ className: "text-center",
476
+ children: /*#__PURE__*/jsx(Typography, {
477
+ style: "body2",
478
+ children: t("neetoPayments.common.notAvailable")
479
+ })
480
+ })
481
+ });
431
482
  }
432
- return /*#__PURE__*/React.createElement(DateFormat.DateTime, {
433
- date: date
483
+ return /*#__PURE__*/jsx(DateFormat.DateTime, {
484
+ date
434
485
  });
435
486
  };
436
- var renderPlatformShare = function renderPlatformShare(amount) {
487
+ const renderPlatformShare = amount => {
437
488
  if (isNotPresent(amount)) {
438
- return /*#__PURE__*/React.createElement(Tooltip, {
489
+ return /*#__PURE__*/jsx(Tooltip, {
439
490
  content: t("neetoPayments.tooltipContent.platformShareUnavailable"),
440
- position: "top"
441
- }, /*#__PURE__*/React.createElement(Typography, {
442
- style: "body2"
443
- }, t("neetoPayments.common.notCalculated")));
491
+ position: "top",
492
+ children: /*#__PURE__*/jsx(Typography, {
493
+ style: "body2",
494
+ children: t("neetoPayments.common.notCalculated")
495
+ })
496
+ });
444
497
  }
445
498
  return formatAmount(amount);
446
499
  };
447
- var getDefaultColumns = function getDefaultColumns(setSelectedTransfer) {
448
- return [{
449
- title: t("neetoPayments.common.id"),
450
- dataIndex: "rowId",
451
- key: "rowId",
452
- width: 85,
453
- position: 0,
454
- isHidable: false
455
- }, {
456
- title: t("neetoPayments.common.identifier"),
457
- dataIndex: "identifier",
458
- key: "identifier",
459
- width: 300,
460
- render: renderIdentifier(setSelectedTransfer),
461
- position: 1,
462
- isHidable: false
463
- }, {
464
- title: t("neetoPayments.common.status"),
465
- dataIndex: "status",
466
- key: "status",
467
- width: 150,
468
- render: renderStatus("splitTransfers"),
469
- sorter: true,
470
- position: 2,
471
- isHidable: false
472
- }, {
473
- title: t("neetoPayments.common.amount"),
474
- dataIndex: "amount",
475
- key: "amount",
476
- width: 150,
477
- sorter: true,
478
- render: formatAmount,
479
- position: 3
480
- }, {
481
- title: t("neetoPayments.common.currency"),
482
- dataIndex: "currency",
483
- key: "currency",
484
- width: 160,
485
- sorter: true,
486
- render: formatCurrency,
487
- position: 3
488
- }, {
489
- title: t("neetoPayments.common.platformShare"),
490
- dataIndex: "platformShare",
491
- key: "platformShare",
492
- width: 205,
493
- render: renderPlatformShare,
494
- sorter: true,
495
- position: 3
496
- }, {
497
- title: t("neetoPayments.common.transferTime"),
498
- dataIndex: "paymentAt",
499
- key: "paymentAt",
500
- width: 190,
501
- render: renderDate,
502
- sorter: true,
503
- position: 10
504
- }, {
505
- title: t("neetoPayments.common.platformPayment"),
506
- dataIndex: "sourcePayment",
507
- key: "sourcePayment",
508
- render: renderPlatformPaymentIdentifier,
509
- width: 300,
510
- position: 19
511
- }, {
512
- title: t("neetoPayments.common.accountIdentifier"),
513
- dataIndex: "destinationAccount",
514
- key: "destinationAccount",
515
- render: renderDestinationAccountIdentifier,
516
- width: 320,
517
- position: 20
518
- }];
519
- };
500
+ const getDefaultColumns = setSelectedTransfer => [{
501
+ title: t("neetoPayments.common.id"),
502
+ dataIndex: "rowId",
503
+ key: "rowId",
504
+ width: 85,
505
+ position: 0,
506
+ isHidable: false
507
+ }, {
508
+ title: t("neetoPayments.common.identifier"),
509
+ dataIndex: "identifier",
510
+ key: "identifier",
511
+ width: 300,
512
+ render: renderIdentifier(setSelectedTransfer),
513
+ position: 1,
514
+ isHidable: false
515
+ }, {
516
+ title: t("neetoPayments.common.status"),
517
+ dataIndex: "status",
518
+ key: "status",
519
+ width: 150,
520
+ render: renderStatus("splitTransfers"),
521
+ sorter: true,
522
+ position: 2,
523
+ isHidable: false
524
+ }, {
525
+ title: t("neetoPayments.common.amount"),
526
+ dataIndex: "amount",
527
+ key: "amount",
528
+ width: 150,
529
+ sorter: true,
530
+ render: formatAmount,
531
+ position: 3
532
+ }, {
533
+ title: t("neetoPayments.common.currency"),
534
+ dataIndex: "currency",
535
+ key: "currency",
536
+ width: 160,
537
+ sorter: true,
538
+ render: formatCurrency,
539
+ position: 3
540
+ }, {
541
+ title: t("neetoPayments.common.platformShare"),
542
+ dataIndex: "platformShare",
543
+ key: "platformShare",
544
+ width: 205,
545
+ render: renderPlatformShare,
546
+ sorter: true,
547
+ position: 3
548
+ }, {
549
+ title: t("neetoPayments.common.transferTime"),
550
+ dataIndex: "paymentAt",
551
+ key: "paymentAt",
552
+ width: 190,
553
+ render: renderDate,
554
+ sorter: true,
555
+ position: 10
556
+ }, {
557
+ title: t("neetoPayments.common.platformPayment"),
558
+ dataIndex: "sourcePayment",
559
+ key: "sourcePayment",
560
+ render: renderPlatformPaymentIdentifier,
561
+ width: 300,
562
+ position: 19
563
+ }, {
564
+ title: t("neetoPayments.common.accountIdentifier"),
565
+ dataIndex: "destinationAccount",
566
+ key: "destinationAccount",
567
+ render: renderDestinationAccountIdentifier,
568
+ width: 320,
569
+ position: 20
570
+ }];
520
571
 
521
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
522
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
523
- var buildSearchProps = function buildSearchProps(searchProps, searchTerm) {
524
- return mergeDeepWith(concat, SEARCH_PROPS, mergeLeft({
525
- value: searchTerm.trim()
526
- }, searchProps));
527
- };
528
- var buildFilterColumns = function buildFilterColumns() {
529
- var payableEntityColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
530
- return reject(isNil, concat(FILTER_COLUMNS, map(prop("filterProps"), payableEntityColumns)));
531
- };
532
- var buildTableColumns = function buildTableColumns(_ref) {
533
- var tab = _ref.tab,
534
- _ref$payableEntityCol = _ref.payableEntityColumns,
535
- payableEntityColumns = _ref$payableEntityCol === void 0 ? [] : _ref$payableEntityCol,
536
- setSelectedTransfer = _ref.setSelectedTransfer;
537
- var filteredColumns = sortBy(prop("position"), concat(getDefaultColumns(setSelectedTransfer), payableEntityColumns));
572
+ const buildSearchProps = (searchProps, searchTerm) => mergeDeepWith(concat, SEARCH_PROPS, mergeLeft({
573
+ value: searchTerm.trim()
574
+ }, searchProps));
575
+ const buildFilterColumns = (payableEntityColumns = []) => reject(isNil, concat(FILTER_COLUMNS, map(prop("filterProps"), payableEntityColumns)));
576
+ const buildTableColumns = ({
577
+ tab,
578
+ payableEntityColumns = [],
579
+ setSelectedTransfer
580
+ }) => {
581
+ const filteredColumns = sortBy(prop("position"), concat(getDefaultColumns(setSelectedTransfer), payableEntityColumns));
538
582
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) return filteredColumns;
539
583
  return removeBy({
540
584
  key: "status"
541
585
  }, filteredColumns);
542
586
  };
543
- var buildRowData = function buildRowData(_ref2) {
544
- var splitTransfers = _ref2.splitTransfers,
545
- _ref2$pageProperties = _ref2.pageProperties,
546
- pageProperties = _ref2$pageProperties === void 0 ? {} : _ref2$pageProperties;
547
- return splitTransfers === null || splitTransfers === void 0 ? void 0 : splitTransfers.map(function (element, index) {
548
- return _objectSpread$1(_objectSpread$1({}, element), {}, {
549
- rowId: isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
550
- });
551
- });
552
- };
587
+ const buildRowData = ({
588
+ splitTransfers,
589
+ pageProperties = {}
590
+ }) => splitTransfers?.map((element, index) => ({
591
+ ...element,
592
+ rowId: isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
593
+ }));
553
594
 
554
- var List = function List(_ref) {
555
- var isFetching = _ref.isFetching,
556
- splitTransfers = _ref.splitTransfers,
557
- selectedRows = _ref.selectedRows,
558
- views = _ref.views,
559
- payableEntityColumns = _ref.payableEntityColumns,
560
- pageProperties = _ref.pageProperties,
561
- onRowSelect = _ref.onRowSelect,
562
- setSortProperties = _ref.setSortProperties,
563
- handleTablePagination = _ref.handleTablePagination,
564
- setHasBulkSelectedAllRows = _ref.setHasBulkSelectedAllRows;
565
- var _useState = useState(INITIAL_TRANSFER_DETAILS),
566
- _useState2 = _slicedToArray(_useState, 2),
567
- selectedTransfer = _useState2[0],
568
- setSelectedTransfer = _useState2[1];
569
- var _useTranslation = useTranslation(),
570
- t = _useTranslation.t;
571
- var _getQueryParams = getQueryParams(),
572
- _getQueryParams$tab = _getQueryParams.tab,
573
- tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
574
- var splitTransfersCount = views[tab];
575
- var getRowSelection = function getRowSelection() {
595
+ const List = ({
596
+ isFetching,
597
+ splitTransfers,
598
+ selectedRows,
599
+ views,
600
+ payableEntityColumns,
601
+ pageProperties,
602
+ onRowSelect,
603
+ setSortProperties,
604
+ handleTablePagination,
605
+ setHasBulkSelectedAllRows
606
+ }) => {
607
+ const [selectedTransfer, setSelectedTransfer] = useState(INITIAL_TRANSFER_DETAILS);
608
+ const {
609
+ t
610
+ } = useTranslation();
611
+ const {
612
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
613
+ } = getQueryParams();
614
+ const splitTransfersCount = views[tab];
615
+ const getRowSelection = () => {
576
616
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.successful) return false;
577
617
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) {
578
618
  return {
579
- getCheckboxProps: function getCheckboxProps(record) {
580
- return {
581
- disabled: record.status === SPLIT_TRANSFERS_DASHBOARD_TAB.successful
582
- };
583
- }
619
+ getCheckboxProps: record => ({
620
+ disabled: record.status === SPLIT_TRANSFERS_DASHBOARD_TAB.successful
621
+ })
584
622
  };
585
623
  }
586
624
  return true;
587
625
  };
588
- var allColumns = buildTableColumns({
589
- tab: tab,
590
- payableEntityColumns: payableEntityColumns,
591
- setSelectedTransfer: setSelectedTransfer
626
+ const allColumns = buildTableColumns({
627
+ tab,
628
+ payableEntityColumns,
629
+ setSelectedTransfer
592
630
  });
593
- var _useTableConfiguratio = useTableConfigurations("".concat(TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab), allColumns),
594
- isTableConfigurationLoading = _useTableConfiguratio.isTableConfigurationLoading,
595
- customizedColumns = _useTableConfiguratio.customizedColumns,
596
- hideColumn = _useTableConfiguratio.hideColumn;
597
- var handleTableChange = function handleTableChange(_, __, sorter) {
598
- setSortProperties(isPresent(sorter === null || sorter === void 0 ? void 0 : sorter.column) ? {
631
+ const {
632
+ isTableConfigurationLoading,
633
+ customizedColumns,
634
+ hideColumn
635
+ } = useTableConfigurations(`${TABLE_KEYS.SPLIT_TRANSFERS_TABLE}-${tab}`, allColumns);
636
+ const handleTableChange = (_, __, sorter) => {
637
+ setSortProperties(isPresent(sorter?.column) ? {
599
638
  sortBy: camelToSnakeCase(processDataIndex(sorter.field)),
600
639
  orderBy: sorter.order === "ascend" ? "ASC" : "DESC"
601
640
  } : DEFAULT_SORT_PROPERTIES);
602
641
  };
603
642
  if (isNotPresent(splitTransfers)) {
604
- return /*#__PURE__*/React.createElement("div", {
605
- className: "flex h-full w-full items-center justify-center"
606
- }, /*#__PURE__*/React.createElement(NoData, {
607
- title: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.splitTransfers") : t("neetoPayments.emptyState.splitTransfersWithStatus", {
608
- status: tab
643
+ return /*#__PURE__*/jsx("div", {
644
+ className: "flex h-full w-full items-center justify-center",
645
+ children: /*#__PURE__*/jsx(NoData, {
646
+ title: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.splitTransfers") : t("neetoPayments.emptyState.splitTransfersWithStatus", {
647
+ status: tab
648
+ })
609
649
  })
610
- }));
650
+ });
611
651
  }
612
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableWrapper, {
613
- hasPagination: splitTransfersCount > (pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize)
614
- }, /*#__PURE__*/React.createElement(Table, {
615
- onRowSelect: onRowSelect,
616
- fixedHeight: true,
617
- allowRowClick: false,
618
- columnData: customizedColumns,
619
- currentPageNumber: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.page,
620
- handlePageChange: handleTablePagination,
621
- loading: isFetching || isTableConfigurationLoading,
622
- rowData: buildRowData({
623
- splitTransfers: splitTransfers,
624
- pageProperties: pageProperties,
625
- tab: tab
626
- }),
627
- rowSelection: getRowSelection(),
628
- selectedRowKeys: selectedRows,
629
- sortDirections: SORT_DIRECTIONS,
630
- totalCount: splitTransfersCount,
631
- bulkSelectAllRowsProps: {
632
- selectAllRowMessage: t("neetoPayments.splitTransferDetails.selectedSplitTransfers", {
633
- count: selectedRows.length
634
- }),
635
- selectAllRowButtonLabel: t("neetoPayments.splitTransferDetails.selectAll", {
636
- count: views[SPLIT_TRANSFERS_DASHBOARD_TAB.pending]
637
- }),
638
- setBulkSelectedAllRows: setHasBulkSelectedAllRows
639
- },
640
- paginationProps: {
641
- showSizeChanger: true,
642
- hideOnSinglePage: true,
643
- pageSize: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize,
644
- total: splitTransfersCount
645
- },
646
- onChange: handleTableChange,
647
- onColumnHide: function onColumnHide(_ref2) {
648
- var key = _ref2.key;
649
- return hideColumn(key);
650
- }
651
- })), /*#__PURE__*/React.createElement(Details, {
652
- selectedTransfer: selectedTransfer,
653
- setSelectedTransfer: setSelectedTransfer
654
- }));
652
+ return /*#__PURE__*/jsxs(Fragment, {
653
+ children: [/*#__PURE__*/jsx(TableWrapper, {
654
+ hasPagination: splitTransfersCount > pageProperties?.pageSize,
655
+ children: /*#__PURE__*/jsx(Table, {
656
+ onRowSelect,
657
+ fixedHeight: true,
658
+ allowRowClick: false,
659
+ columnData: customizedColumns,
660
+ currentPageNumber: pageProperties?.page,
661
+ handlePageChange: handleTablePagination,
662
+ loading: isFetching || isTableConfigurationLoading,
663
+ rowData: buildRowData({
664
+ splitTransfers,
665
+ pageProperties,
666
+ tab
667
+ }),
668
+ rowSelection: getRowSelection(),
669
+ selectedRowKeys: selectedRows,
670
+ sortDirections: SORT_DIRECTIONS,
671
+ totalCount: splitTransfersCount,
672
+ bulkSelectAllRowsProps: {
673
+ selectAllRowMessage: t("neetoPayments.splitTransferDetails.selectedSplitTransfers", {
674
+ count: selectedRows.length
675
+ }),
676
+ selectAllRowButtonLabel: t("neetoPayments.splitTransferDetails.selectAll", {
677
+ count: views[SPLIT_TRANSFERS_DASHBOARD_TAB.pending]
678
+ }),
679
+ setBulkSelectedAllRows: setHasBulkSelectedAllRows
680
+ },
681
+ paginationProps: {
682
+ showSizeChanger: true,
683
+ hideOnSinglePage: true,
684
+ pageSize: pageProperties?.pageSize,
685
+ total: splitTransfersCount
686
+ },
687
+ onChange: handleTableChange,
688
+ onColumnHide: ({
689
+ key
690
+ }) => hideColumn(key)
691
+ })
692
+ }), /*#__PURE__*/jsx(Details, {
693
+ selectedTransfer,
694
+ setSelectedTransfer
695
+ })]
696
+ });
655
697
  };
656
698
 
657
- var ResumeModal = function ResumeModal(_ref) {
658
- var isOpen = _ref.isOpen,
659
- onClose = _ref.onClose,
660
- handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
661
- var _useTranslation = useTranslation(),
662
- t = _useTranslation.t;
663
- var handleSubmit = function handleSubmit(_ref2) {
664
- var reason = _ref2.reason;
699
+ const ResumeModal = ({
700
+ isOpen,
701
+ onClose,
702
+ handleSplitTransfersUpdate
703
+ }) => {
704
+ const {
705
+ t
706
+ } = useTranslation();
707
+ const handleSubmit = ({
708
+ reason
709
+ }) => {
665
710
  handleSplitTransfersUpdate("pending", reason);
666
711
  };
667
- return /*#__PURE__*/React.createElement(Modal, {
668
- isOpen: isOpen,
669
- onClose: onClose,
670
- size: "large"
671
- }, /*#__PURE__*/React.createElement(Modal.Header, null, /*#__PURE__*/React.createElement(Typography, {
672
- style: "h2",
673
- weight: "medium"
674
- }, t("neetoPayments.resumeSplitTransfers.modal.title"))), /*#__PURE__*/React.createElement(Form, {
675
- formikProps: {
676
- initialValues: {
677
- reason: ""
712
+ return /*#__PURE__*/jsxs(Modal, {
713
+ isOpen,
714
+ onClose,
715
+ size: "large",
716
+ children: [/*#__PURE__*/jsx(Modal.Header, {
717
+ children: /*#__PURE__*/jsx(Typography, {
718
+ style: "h2",
719
+ weight: "medium",
720
+ children: t("neetoPayments.resumeSplitTransfers.modal.title")
721
+ })
722
+ }), /*#__PURE__*/jsx(Form, {
723
+ formikProps: {
724
+ initialValues: {
725
+ reason: ""
726
+ },
727
+ validationSchema: VALIDATION_SCHEMA,
728
+ onSubmit: handleSubmit
678
729
  },
679
- validationSchema: VALIDATION_SCHEMA,
680
- onSubmit: handleSubmit
681
- }
682
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal.Body, null, /*#__PURE__*/React.createElement("div", {
683
- className: "flex flex-col space-y-4"
684
- }, /*#__PURE__*/React.createElement(Textarea, {
685
- required: true,
686
- label: t("neetoPayments.resumeSplitTransfers.modal.reason"),
687
- name: "reason"
688
- }))), /*#__PURE__*/React.createElement(Modal.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
689
- position: "right",
690
- cancelButtonProps: {
691
- onClick: onClose,
692
- style: "tertiary"
693
- },
694
- submitButtonProps: {
695
- disabled: false,
696
- label: t("neetoPayments.common.submit")
697
- }
698
- })))));
730
+ children: /*#__PURE__*/jsxs(Fragment, {
731
+ children: [/*#__PURE__*/jsx(Modal.Body, {
732
+ children: /*#__PURE__*/jsx("div", {
733
+ className: "flex flex-col space-y-4",
734
+ children: /*#__PURE__*/jsx(Textarea, {
735
+ required: true,
736
+ label: t("neetoPayments.resumeSplitTransfers.modal.reason"),
737
+ name: "reason"
738
+ })
739
+ })
740
+ }), /*#__PURE__*/jsx(Modal.Footer, {
741
+ children: /*#__PURE__*/jsx(ActionBlock, {
742
+ position: "right",
743
+ cancelButtonProps: {
744
+ onClick: onClose,
745
+ style: "tertiary"
746
+ },
747
+ submitButtonProps: {
748
+ disabled: false,
749
+ label: t("neetoPayments.common.submit")
750
+ }
751
+ })
752
+ })]
753
+ })
754
+ })]
755
+ });
699
756
  };
700
757
 
701
- var Menu = Dropdown.Menu,
702
- MenuItem = Dropdown.MenuItem;
703
- var TopSection = function TopSection(_ref) {
704
- var views = _ref.views,
705
- filters = _ref.filters,
706
- setIsCancelModalOpen = _ref.setIsCancelModalOpen,
707
- setIsResumeModalOpen = _ref.setIsResumeModalOpen,
708
- selectedRows = _ref.selectedRows,
709
- selectedRowData = _ref.selectedRowData,
710
- setFilters = _ref.setFilters,
711
- hasBulkSelectedAllRows = _ref.hasBulkSelectedAllRows,
712
- filterableColumns = _ref.filterableColumns,
713
- searchKeywordProps = _ref.searchKeywordProps,
714
- payableEntityColumns = _ref.payableEntityColumns,
715
- setIsExportModalOpen = _ref.setIsExportModalOpen;
716
- var _useState = useState(false),
717
- _useState2 = _slicedToArray(_useState, 2),
718
- isFilterPaneOpen = _useState2[0],
719
- setIsFilterPaneOpen = _useState2[1];
720
- var _useTranslation = useTranslation(),
721
- t = _useTranslation.t;
722
- var history = useHistory();
723
- var _getQueryParams = getQueryParams(),
724
- _getQueryParams$tab = _getQueryParams.tab,
725
- tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
726
- var splitTransfersCount = views === null || views === void 0 ? void 0 : views[tab];
727
- var splitTransfersCountVisible = splitTransfersCount > 0 || splitTransfersCount === 0 && isPresent(filters);
728
- var isFilterButtonVisible = splitTransfersCount || isPresent(filters);
729
- var isDropdownVisible = isNotEmpty(selectedRows);
730
- var isCancelButtonDisabled = existsBy({
758
+ const {
759
+ Menu,
760
+ MenuItem
761
+ } = Dropdown;
762
+ const TopSection = ({
763
+ views,
764
+ filters,
765
+ setIsCancelModalOpen,
766
+ setIsResumeModalOpen,
767
+ selectedRows,
768
+ selectedRowData,
769
+ setFilters,
770
+ hasBulkSelectedAllRows,
771
+ filterableColumns,
772
+ searchKeywordProps,
773
+ payableEntityColumns,
774
+ setIsExportModalOpen
775
+ }) => {
776
+ const [isFilterPaneOpen, setIsFilterPaneOpen] = useState(false);
777
+ const {
778
+ t
779
+ } = useTranslation();
780
+ const history = useHistory();
781
+ const {
782
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
783
+ } = getQueryParams();
784
+ const splitTransfersCount = views?.[tab];
785
+ const splitTransfersCountVisible = splitTransfersCount > 0 || splitTransfersCount === 0 && isPresent(filters);
786
+ const isFilterButtonVisible = splitTransfersCount || isPresent(filters);
787
+ const isDropdownVisible = isNotEmpty(selectedRows);
788
+ const isCancelButtonDisabled = existsBy({
731
789
  status: SPLIT_TRANSFERS_DASHBOARD_TAB.cancelled
732
790
  }, selectedRowData);
733
- var isResumeButtonDisabled = existsBy({
791
+ const isResumeButtonDisabled = existsBy({
734
792
  status: SPLIT_TRANSFERS_DASHBOARD_TAB.pending
735
793
  }, selectedRowData);
736
- var selectedRecordsCount = hasBulkSelectedAllRows ? splitTransfersCount : selectedRows.length;
737
- var handleFiltersChange = function handleFiltersChange(filters) {
738
- startTransition(function () {
794
+ const selectedRecordsCount = hasBulkSelectedAllRows ? splitTransfersCount : selectedRows.length;
795
+ const handleFiltersChange = filters => {
796
+ startTransition(() => {
739
797
  setFilters(filters);
740
798
  });
741
799
  };
742
- var handleTabChange = function handleTabChange(tab) {
743
- var queryParams = getQueryParams({
800
+ const handleTabChange = tab => {
801
+ const queryParams = getQueryParams({
744
802
  toCamelCase: false
745
803
  });
746
- var newParams = {
747
- tab: tab,
804
+ const newParams = {
805
+ tab,
748
806
  page: DEFAULT_PAGE_INDEX,
749
807
  page_size: DEFAULT_PAGE_SIZE
750
808
  };
751
809
  history.push(buildUrl(window.location.pathname, mergeLeft(newParams, queryParams)));
752
810
  };
753
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
754
- title: t("neetoPayments.title.splitTransfers"),
755
- searchProps: isFilterButtonVisible && {
756
- placeholder: searchKeywordProps.placeholder,
757
- className: "w-96"
758
- }
759
- }), shouldTabsVisible(views) && /*#__PURE__*/React.createElement(Tab, null, Object.keys(SPLIT_TRANSFERS_DASHBOARD_TAB).map(function (item) {
760
- return /*#__PURE__*/React.createElement(Tab.Item, {
761
- active: tab === item,
762
- key: item,
763
- onClick: function onClick() {
764
- return handleTabChange(item);
811
+ return /*#__PURE__*/jsxs(Fragment, {
812
+ children: [/*#__PURE__*/jsx(Header, {
813
+ title: t("neetoPayments.title.splitTransfers"),
814
+ searchProps: isFilterButtonVisible && {
815
+ placeholder: searchKeywordProps.placeholder,
816
+ className: "w-96"
765
817
  }
766
- }, t("neetoPayments.common.".concat(item)));
767
- })), /*#__PURE__*/React.createElement(SubHeader, {
768
- className: "my-4",
769
- leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/React.createElement("div", {
770
- className: "w-100 flex items-center space-x-3"
771
- }, isDropdownVisible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
772
- className: "neeto-ui-gray-800 me-2 font-semibold",
773
- component: "h4"
774
- }, /*#__PURE__*/React.createElement(Trans, {
775
- count: selectedRecordsCount,
776
- i18nKey: "neetoPayments.splitTransferDetails.recordWithCount",
777
- components: {
778
- span: /*#__PURE__*/React.createElement("span", {
779
- className: "neeto-ui-text-gray-600"
818
+ }), shouldTabsVisible(views) && /*#__PURE__*/jsx(Tab, {
819
+ children: Object.keys(SPLIT_TRANSFERS_DASHBOARD_TAB).map(item => /*#__PURE__*/jsx(Tab.Item, {
820
+ active: tab === item,
821
+ onClick: () => handleTabChange(item),
822
+ children: t(`neetoPayments.common.${item}`)
823
+ }, item))
824
+ }), /*#__PURE__*/jsx(SubHeader, {
825
+ className: "my-4",
826
+ leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/jsx("div", {
827
+ className: "w-100 flex items-center space-x-3",
828
+ children: isDropdownVisible ? /*#__PURE__*/jsxs(Fragment, {
829
+ children: [/*#__PURE__*/jsx(Typography, {
830
+ className: "neeto-ui-gray-800 me-2 font-semibold",
831
+ component: "h4",
832
+ children: /*#__PURE__*/jsx(Trans, {
833
+ count: selectedRecordsCount,
834
+ i18nKey: "neetoPayments.splitTransferDetails.recordWithCount",
835
+ components: {
836
+ span: /*#__PURE__*/jsx("span", {
837
+ className: "neeto-ui-text-gray-600"
838
+ })
839
+ },
840
+ values: {
841
+ count: selectedRecordsCount,
842
+ recordsCount: splitTransfersCount
843
+ }
844
+ })
845
+ }), /*#__PURE__*/jsxs(Dropdown, {
846
+ buttonStyle: "secondary",
847
+ label: t("neetoPayments.common.takeAction"),
848
+ children: [/*#__PURE__*/jsx(Menu, {
849
+ children: /*#__PURE__*/jsx(MenuItem.Button, {
850
+ isDisabled: isCancelButtonDisabled,
851
+ tooltipProps: isCancelButtonDisabled ? {
852
+ content: t("neetoPayments.tooltipContent.splitTransfers.cancelledRecordsSelected")
853
+ } : "",
854
+ onClick: () => setIsCancelModalOpen(true),
855
+ children: t("neetoPayments.common.cancel")
856
+ })
857
+ }), /*#__PURE__*/jsx(Menu, {
858
+ children: /*#__PURE__*/jsx(MenuItem.Button, {
859
+ isDisabled: isResumeButtonDisabled,
860
+ tooltipProps: isResumeButtonDisabled ? {
861
+ content: t("neetoPayments.tooltipContent.splitTransfers.pendingRecordsSelected")
862
+ } : "",
863
+ onClick: () => setIsResumeModalOpen(true),
864
+ children: t("neetoPayments.common.resume")
865
+ })
866
+ })]
867
+ })]
868
+ }) : /*#__PURE__*/jsx(Typography, {
869
+ className: "neeto-ui-gray-800 me-2 font-semibold",
870
+ component: "h4",
871
+ children: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.countOf.splitTransfer", {
872
+ count: splitTransfersCount
873
+ }) : t("neetoPayments.countOf.splitTransferWithStatus", {
874
+ count: splitTransfersCount,
875
+ status: tab
876
+ })
780
877
  })
781
- },
782
- values: {
783
- count: selectedRecordsCount,
784
- recordsCount: splitTransfersCount
785
- }
786
- })), /*#__PURE__*/React.createElement(Dropdown, {
787
- buttonStyle: "secondary",
788
- label: t("neetoPayments.common.takeAction")
789
- }, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
790
- isDisabled: isCancelButtonDisabled,
791
- tooltipProps: isCancelButtonDisabled ? {
792
- content: t("neetoPayments.tooltipContent.splitTransfers.cancelledRecordsSelected")
793
- } : "",
794
- onClick: function onClick() {
795
- return setIsCancelModalOpen(true);
796
- }
797
- }, t("neetoPayments.common.cancel"))), /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
798
- isDisabled: isResumeButtonDisabled,
799
- tooltipProps: isResumeButtonDisabled ? {
800
- content: t("neetoPayments.tooltipContent.splitTransfers.pendingRecordsSelected")
801
- } : "",
802
- onClick: function onClick() {
803
- return setIsResumeModalOpen(true);
804
- }
805
- }, t("neetoPayments.common.resume"))))) : /*#__PURE__*/React.createElement(Typography, {
806
- className: "neeto-ui-gray-800 me-2 font-semibold",
807
- component: "h4"
808
- }, tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.countOf.splitTransfer", {
809
- count: splitTransfersCount
810
- }) : t("neetoPayments.countOf.splitTransferWithStatus", {
811
- count: splitTransfersCount,
812
- status: tab
813
- }))),
814
- rightActionBlock: isFilterButtonVisible && /*#__PURE__*/React.createElement(SubHeader.RightBlock, {
815
- columnsButtonProps: {
816
- columnData: buildTableColumns({
817
- tab: tab,
818
- payableEntityColumns: payableEntityColumns,
819
- setSelectedTransfer: function setSelectedTransfer() {}
820
- }).map(modify("dataIndex", processDataIndex)),
821
- fixedColumns: UN_HIDEABLE_COLUMNS,
822
- tableKey: "".concat(TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab)
823
- },
824
- downloadButtonProps: {
825
- onClick: function onClick() {
826
- return setIsExportModalOpen(true);
878
+ }),
879
+ rightActionBlock: isFilterButtonVisible && /*#__PURE__*/jsx(SubHeader.RightBlock, {
880
+ columnsButtonProps: {
881
+ columnData: buildTableColumns({
882
+ tab,
883
+ payableEntityColumns,
884
+ setSelectedTransfer: () => {}
885
+ }).map(modify("dataIndex", processDataIndex)),
886
+ fixedColumns: UN_HIDEABLE_COLUMNS,
887
+ tableKey: `${TABLE_KEYS.SPLIT_TRANSFERS_TABLE}-${tab}`
888
+ },
889
+ downloadButtonProps: {
890
+ onClick: () => setIsExportModalOpen(true)
891
+ },
892
+ filterProps: {
893
+ columns: filterableColumns,
894
+ isOpen: isFilterPaneOpen,
895
+ keyword: searchKeywordProps,
896
+ setIsOpen: setIsFilterPaneOpen,
897
+ onChange: handleFiltersChange
827
898
  }
828
- },
829
- filterProps: {
830
- columns: filterableColumns,
831
- isOpen: isFilterPaneOpen,
832
- keyword: searchKeywordProps,
833
- setIsOpen: setIsFilterPaneOpen,
834
- onChange: handleFiltersChange
835
- }
836
- })
837
- }), /*#__PURE__*/React.createElement(Bar, {
838
- columns: filterableColumns,
839
- keyword: searchKeywordProps,
840
- setIsPaneOpen: setIsFilterPaneOpen,
841
- onChange: handleFiltersChange
842
- }));
899
+ })
900
+ }), /*#__PURE__*/jsx(Bar, {
901
+ columns: filterableColumns,
902
+ keyword: searchKeywordProps,
903
+ setIsPaneOpen: setIsFilterPaneOpen,
904
+ onChange: handleFiltersChange
905
+ })]
906
+ });
843
907
  };
844
908
 
845
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
846
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
847
- var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
848
- var searchProps = _ref.searchProps,
849
- payableEntityColumns = _ref.payableEntityColumns;
850
- var _getQueryParams = getQueryParams(),
851
- _getQueryParams$searc = _getQueryParams.searchTerm,
852
- searchTerm = _getQueryParams$searc === void 0 ? "" : _getQueryParams$searc;
853
- var filterableColumns = buildFilterColumns(payableEntityColumns);
854
- var searchKeywordProps = buildSearchProps(searchProps, searchTerm);
855
- var _useState = useState([]),
856
- _useState2 = _slicedToArray(_useState, 2),
857
- selectedRows = _useState2[0],
858
- setSelectedRows = _useState2[1];
859
- var _useState3 = useState([]),
860
- _useState4 = _slicedToArray(_useState3, 2),
861
- selectedRowData = _useState4[0],
862
- setSelectedRowData = _useState4[1];
863
- var _useState5 = useState(false),
864
- _useState6 = _slicedToArray(_useState5, 2),
865
- isExportModalOpen = _useState6[0],
866
- setIsExportModalOpen = _useState6[1];
867
- var _useState7 = useState(false),
868
- _useState8 = _slicedToArray(_useState7, 2),
869
- isCancelModalOpen = _useState8[0],
870
- setIsCancelModalOpen = _useState8[1];
871
- var _useState9 = useState(false),
872
- _useState10 = _slicedToArray(_useState9, 2),
873
- isResumeModalOpen = _useState10[0],
874
- setIsResumeModalOpen = _useState10[1];
875
- var _useState11 = useState(false),
876
- _useState12 = _slicedToArray(_useState11, 2),
877
- hasBulkSelectedAllRows = _useState12[0],
878
- setHasBulkSelectedAllRows = _useState12[1];
879
- var _useState13 = useState(DEFAULT_SORT_PROPERTIES),
880
- _useState14 = _slicedToArray(_useState13, 2),
881
- sortProperties = _useState14[0],
882
- setSortProperties = _useState14[1];
883
- var _useState15 = useState(DEFAULT_PAGE_VALUES),
884
- _useState16 = _slicedToArray(_useState15, 2),
885
- pageProperties = _useState16[0],
886
- setPageProperties = _useState16[1];
887
- var _useState17 = useState(buildFiltersFromURL([].concat(_toConsumableArray(filterableColumns), [searchKeywordProps]))),
888
- _useState18 = _slicedToArray(_useState17, 2),
889
- filters = _useState18[0],
890
- setFilters = _useState18[1];
891
- var history = useHistory();
892
- var _getQueryParams2 = getQueryParams(),
893
- _getQueryParams2$tab = _getQueryParams2.tab,
894
- tab = _getQueryParams2$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams2$tab;
895
- var payload = _objectSpread(_objectSpread({
896
- tab: tab,
897
- filters: filters
898
- }, pageProperties), sortProperties);
899
- var _useFetchSplitTransfe = useFetchSplitTransfers(payload),
900
- _useFetchSplitTransfe2 = _useFetchSplitTransfe.data,
901
- _useFetchSplitTransfe3 = _useFetchSplitTransfe2 === void 0 ? {} : _useFetchSplitTransfe2,
902
- splitTransfers = _useFetchSplitTransfe3.splitTransfers,
903
- views = _useFetchSplitTransfe3.views,
904
- isFetching = _useFetchSplitTransfe.isFetching,
905
- isSplitTransfersLoading = _useFetchSplitTransfe.isPending;
906
- var _useBulkUpdateSplitTr = useBulkUpdateSplitTransfers({
907
- onSuccess: function onSuccess() {
908
- setSelectedRowData([]);
909
- setSelectedRows([]);
910
- }
911
- }),
912
- updateSplitTransfers = _useBulkUpdateSplitTr.mutate,
913
- isCancelling = _useBulkUpdateSplitTr.isPending;
914
- var handleSplitTransfersUpdate = function handleSplitTransfersUpdate(status, reason) {
915
- var ids = pluck("id", selectedRowData);
909
+ const SplitTransfersDashboard = ({
910
+ searchProps,
911
+ payableEntityColumns
912
+ }) => {
913
+ const {
914
+ searchTerm = ""
915
+ } = getQueryParams();
916
+ const filterableColumns = buildFilterColumns(payableEntityColumns);
917
+ const searchKeywordProps = buildSearchProps(searchProps, searchTerm);
918
+ const [selectedRows, setSelectedRows] = useState([]);
919
+ const [selectedRowData, setSelectedRowData] = useState([]);
920
+ const [isExportModalOpen, setIsExportModalOpen] = useState(false);
921
+ const [isCancelModalOpen, setIsCancelModalOpen] = useState(false);
922
+ const [isResumeModalOpen, setIsResumeModalOpen] = useState(false);
923
+ const [hasBulkSelectedAllRows, setHasBulkSelectedAllRows] = useState(false);
924
+ const [sortProperties, setSortProperties] = useState(DEFAULT_SORT_PROPERTIES);
925
+ const [pageProperties, setPageProperties] = useState(DEFAULT_PAGE_VALUES);
926
+ const [filters, setFilters] = useState(buildFiltersFromURL([...filterableColumns, searchKeywordProps]));
927
+ const history = useHistory();
928
+ const {
929
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
930
+ } = getQueryParams();
931
+ const payload = {
932
+ tab,
933
+ filters,
934
+ ...pageProperties,
935
+ ...sortProperties
936
+ };
937
+ const {
938
+ data: {
939
+ splitTransfers,
940
+ views
941
+ } = {},
942
+ isFetching,
943
+ isPending: isSplitTransfersLoading
944
+ } = useFetchSplitTransfers(payload);
945
+ const {
946
+ mutate: updateSplitTransfers,
947
+ isPending: isCancelling
948
+ } = useBulkUpdateSplitTransfers({
949
+ onSuccess: () => {
950
+ setSelectedRowData([]);
951
+ setSelectedRows([]);
952
+ }
953
+ });
954
+ const handleSplitTransfersUpdate = (status, reason) => {
955
+ const ids = pluck("id", selectedRowData);
916
956
  updateSplitTransfers({
917
- ids: ids,
918
- status: status,
919
- reason: reason,
957
+ ids,
958
+ status,
959
+ reason,
920
960
  isApplyChangesToAllRequired: hasBulkSelectedAllRows
921
961
  });
922
962
  setIsCancelModalOpen(false);
923
963
  setIsResumeModalOpen(false);
924
964
  };
925
- var handleTablePagination = function handleTablePagination(page, pageSize) {
926
- var queryParams = getQueryParams({
965
+ const handleTablePagination = (page, pageSize) => {
966
+ const queryParams = getQueryParams({
927
967
  toCamelCase: false
928
968
  });
929
969
  history.push(buildUrl(window.location.pathname, mergeLeft({
930
- page: page,
970
+ page,
931
971
  page_size: pageSize
932
972
  }, queryParams)));
933
973
  setPageProperties({
934
- page: page,
935
- pageSize: pageSize
974
+ page,
975
+ pageSize
936
976
  });
937
977
  };
938
- var handleRowSelect = function handleRowSelect(keys, rowData) {
978
+ const handleRowSelect = (keys, rowData) => {
939
979
  setSelectedRows(keys);
940
980
  setSelectedRowData(rowData);
941
981
  };
942
- useEffect(function () {
982
+ useEffect(() => {
943
983
  handleTablePagination(DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE);
944
984
  setSortProperties(DEFAULT_SORT_PROPERTIES);
945
985
  setSelectedRowData([]);
946
986
  setSelectedRows([]);
947
987
  }, [filters, tab]);
948
988
  if (isSplitTransfersLoading || isCancelling) {
949
- return /*#__PURE__*/React.createElement("div", {
950
- className: "flex h-full w-full items-center justify-center"
951
- }, /*#__PURE__*/React.createElement(Spinner, null));
989
+ return /*#__PURE__*/jsx("div", {
990
+ className: "flex h-full w-full items-center justify-center",
991
+ children: /*#__PURE__*/jsx(Spinner, {})
992
+ });
952
993
  }
953
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TopSection, {
954
- filterableColumns: filterableColumns,
955
- filters: filters,
956
- hasBulkSelectedAllRows: hasBulkSelectedAllRows,
957
- pageProperties: pageProperties,
958
- payableEntityColumns: payableEntityColumns,
959
- searchKeywordProps: searchKeywordProps,
960
- selectedRowData: selectedRowData,
961
- selectedRows: selectedRows,
962
- setFilters: setFilters,
963
- setIsCancelModalOpen: setIsCancelModalOpen,
964
- setIsExportModalOpen: setIsExportModalOpen,
965
- setIsResumeModalOpen: setIsResumeModalOpen,
966
- setPageProperties: setPageProperties,
967
- setSortProperties: setSortProperties,
968
- views: views
969
- }), /*#__PURE__*/React.createElement(List, {
970
- handleTablePagination: handleTablePagination,
971
- isFetching: isFetching,
972
- pageProperties: pageProperties,
973
- payableEntityColumns: payableEntityColumns,
974
- selectedRows: selectedRows,
975
- setHasBulkSelectedAllRows: setHasBulkSelectedAllRows,
976
- setSelectedRows: setSelectedRows,
977
- setSortProperties: setSortProperties,
978
- splitTransfers: splitTransfers,
979
- views: views,
980
- onRowSelect: handleRowSelect
981
- }), /*#__PURE__*/React.createElement(ExportModal, {
982
- filters: filters,
983
- isExportModalOpen: isExportModalOpen,
984
- setIsExportModalOpen: setIsExportModalOpen,
985
- sortProperties: sortProperties,
986
- dashboardKind: DASHBOARD_KIND.splitTransfers
987
- }), /*#__PURE__*/React.createElement(CancelModal, {
988
- handleSplitTransfersUpdate: handleSplitTransfersUpdate,
989
- isOpen: isCancelModalOpen,
990
- onClose: function onClose() {
991
- return setIsCancelModalOpen(false);
992
- }
993
- }), /*#__PURE__*/React.createElement(ResumeModal, {
994
- handleSplitTransfersUpdate: handleSplitTransfersUpdate,
995
- isOpen: isResumeModalOpen,
996
- onClose: function onClose() {
997
- return setIsResumeModalOpen(false);
998
- }
999
- }));
994
+ return /*#__PURE__*/jsxs(Fragment, {
995
+ children: [/*#__PURE__*/jsx(TopSection, {
996
+ filterableColumns,
997
+ filters,
998
+ hasBulkSelectedAllRows,
999
+ pageProperties,
1000
+ payableEntityColumns,
1001
+ searchKeywordProps,
1002
+ selectedRowData,
1003
+ selectedRows,
1004
+ setFilters,
1005
+ setIsCancelModalOpen,
1006
+ setIsExportModalOpen,
1007
+ setIsResumeModalOpen,
1008
+ setPageProperties,
1009
+ setSortProperties,
1010
+ views
1011
+ }), /*#__PURE__*/jsx(List, {
1012
+ handleTablePagination,
1013
+ isFetching,
1014
+ pageProperties,
1015
+ payableEntityColumns,
1016
+ selectedRows,
1017
+ setHasBulkSelectedAllRows,
1018
+ setSelectedRows,
1019
+ setSortProperties,
1020
+ splitTransfers,
1021
+ views,
1022
+ onRowSelect: handleRowSelect
1023
+ }), /*#__PURE__*/jsx(ExportModal, {
1024
+ filters,
1025
+ isExportModalOpen,
1026
+ setIsExportModalOpen,
1027
+ sortProperties,
1028
+ dashboardKind: DASHBOARD_KIND.splitTransfers
1029
+ }), /*#__PURE__*/jsx(CancelModal, {
1030
+ handleSplitTransfersUpdate,
1031
+ isOpen: isCancelModalOpen,
1032
+ onClose: () => setIsCancelModalOpen(false)
1033
+ }), /*#__PURE__*/jsx(ResumeModal, {
1034
+ handleSplitTransfersUpdate,
1035
+ isOpen: isResumeModalOpen,
1036
+ onClose: () => setIsResumeModalOpen(false)
1037
+ })]
1038
+ });
1000
1039
  };
1001
1040
 
1002
1041
  export { SplitTransfersDashboard as default };