@opexa/portal-components 0.0.41 → 0.0.43

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 (86) hide show
  1. package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +4 -1
  2. package/dist/client/hooks/useCreateQRPHDepositMutation.js +4 -1
  3. package/dist/client/hooks/useIsMayaSessionValidQuery.js +5 -1
  4. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +15 -4
  5. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +23 -16
  6. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +23 -25
  7. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +23 -16
  8. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDeposit.js +3 -4
  9. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +1 -0
  10. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +96 -0
  11. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +16 -16
  12. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +1 -0
  13. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +16 -0
  14. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.d.ts +1 -1
  15. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +3 -11
  16. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +9 -10
  17. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +38 -51
  18. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDeposit.js +3 -4
  19. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
  20. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +96 -0
  21. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +14 -16
  22. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
  23. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +16 -0
  24. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +1 -1
  25. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +3 -11
  26. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +8 -10
  27. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +37 -54
  28. package/dist/components/DepositWithdrawal/PaymentMethods.js +3 -2
  29. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +23 -19
  30. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +23 -20
  31. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +23 -25
  32. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +23 -19
  33. package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +11 -2
  34. package/dist/icons/SpinnerIcon.js +1 -1
  35. package/dist/images/QRPH.png +0 -0
  36. package/dist/images/gcash.png +0 -0
  37. package/dist/styles/theme.css +28 -1
  38. package/dist/tsconfig.build.tsbuildinfo +1 -1
  39. package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
  40. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
  41. package/dist/ui/Badge/Badge.d.ts +12 -12
  42. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  43. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  44. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  45. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  46. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  47. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  48. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  49. package/dist/ui/Combobox/Combobox.d.ts +196 -196
  50. package/dist/ui/Combobox/combobox.recipe.d.ts +14 -14
  51. package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
  52. package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
  53. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  54. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  55. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  56. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  57. package/dist/ui/Popover/Popover.d.ts +55 -55
  58. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  59. package/dist/ui/Progress/Progress.d.ts +27 -27
  60. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  61. package/dist/ui/Select/Select.d.ts +45 -45
  62. package/dist/ui/Select/select.recipe.d.ts +3 -3
  63. package/dist/ui/Table/Table.d.ts +21 -21
  64. package/dist/ui/Table/table.recipe.d.ts +3 -3
  65. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  66. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  67. package/package.json +10 -5
  68. package/dist/components/AccountVerification/selfie.png +0 -0
  69. package/dist/components/AccountVerification/upload-id.png +0 -0
  70. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositLoading.d.ts +0 -1
  71. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositLoading.js +0 -5
  72. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositSuccess.d.ts +0 -1
  73. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositSuccess.js +0 -5
  74. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.d.ts +0 -1
  75. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +0 -14
  76. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositLoading.d.ts +0 -1
  77. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositLoading.js +0 -5
  78. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.d.ts +0 -1
  79. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +0 -18
  80. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.d.ts +0 -1
  81. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.js +0 -8
  82. package/dist/components/DepositWithdrawal/MayaSessionExpired.d.ts +0 -1
  83. package/dist/components/DepositWithdrawal/MayaSessionExpired.js +0 -5
  84. package/dist/components/PortalProvider/PortalProvider.client.d.ts +0 -2
  85. package/dist/components/PortalProvider/PortalProvider.client.js +0 -38
  86. package/dist/images/QRPh.png +0 -0
@@ -1,73 +1,60 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { useCreateOnlineBankDepositMutation, useDepositQuery, } from '../../../../client/hooks/index.js';
4
- import { toaster } from '../../../../client/utils/index.js';
5
4
  export function useOnlineBankDeposit() {
6
- const [view, setView] = useState('FORM');
7
- const [id, setId] = useState(null);
8
- const [vca, setVca] = useState(null);
9
- const [promo, setPromo] = useState(null);
10
- const [amount, setAmount] = useState(null);
5
+ const [deposit, setDeposit] = useState(null);
6
+ const [status, setStatus] = useState('waiting');
7
+ const view = status === 'verification-failed' ||
8
+ status === 'verification-waiting' ||
9
+ status === 'verification-success' ||
10
+ status === 'verification-processing'
11
+ ? 'vca'
12
+ : 'form';
11
13
  const mutation = useCreateOnlineBankDepositMutation({
14
+ onMutate() {
15
+ setStatus('processing');
16
+ },
12
17
  onSuccess(data) {
13
18
  invariant(data.vca);
14
- setId(data.id);
15
- setVca(data.vca);
16
- setView('VCA');
17
- },
18
- onError(error) {
19
- setView('FORM');
20
- toaster.error({
21
- description: error.message,
22
- });
19
+ setStatus('verification-waiting');
20
+ setDeposit(data);
23
21
  },
24
- onMutate(data) {
25
- setId(null);
26
- setVca(null);
27
- setPromo(data.promo ?? null);
28
- setAmount(data.amount);
29
- setView('LOADING');
22
+ onError() {
23
+ setStatus('failed');
30
24
  },
31
25
  });
32
- const query = useDepositQuery(id ?? undefined, {
33
- enabled: !!id,
26
+ const generateVCA = (input) => mutation.mutate({
27
+ amount: input.amount,
28
+ promo: input.promo ?? undefined,
29
+ });
30
+ const query = useDepositQuery(deposit?.id, {
31
+ enabled: !!deposit,
34
32
  refetchInterval: 5000,
35
33
  });
36
34
  useEffect(() => {
37
- if (query.data?.status === 'CONFIRMED' ||
38
- query.data?.status === 'APPROVED') {
39
- setView('SUCCESS');
35
+ if (query.data?.status === 'APPROVED' ||
36
+ query.data?.status === 'CONFIRMED') {
37
+ setStatus('verification-success');
38
+ }
39
+ if (query.data?.status === 'CANCELLED' ||
40
+ query.data?.status === 'REJECTED' ||
41
+ query.data?.status === 'FAILED') {
42
+ setStatus('verification-failed');
40
43
  }
41
44
  }, [query.data?.status]);
42
- const generateVca = mutation.mutate;
43
- const regenerateVca = () => {
44
- invariant(amount);
45
- mutation.mutate({
46
- amount: amount.toString(),
47
- promo: promo ?? undefined,
48
- });
49
- };
50
45
  const reset = () => {
51
- setId(null);
52
- setVca(null);
53
- setPromo(null);
54
- setAmount(null);
55
- setView('FORM');
46
+ setDeposit(null);
47
+ setStatus('waiting');
48
+ };
49
+ const verify = () => {
50
+ setStatus('verification-processing');
56
51
  };
57
- useEffect(() => {
58
- return () => {
59
- setId(null);
60
- setVca(null);
61
- setPromo(null);
62
- setAmount(null);
63
- setView('FORM');
64
- };
65
- }, []);
66
52
  return {
67
- vca,
68
53
  view,
69
- generateVca,
70
- regenerateVca,
54
+ status,
55
+ verify,
71
56
  reset,
57
+ deposit,
58
+ generateVCA,
72
59
  };
73
60
  }
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { QRPHDepositAlert } from './QRPHDepositAlert.js';
2
3
  import { QRPHDepositContext } from './QRPHDepositContext.js';
4
+ import { QRPHDepositDetails } from './QRPHDepositDetails.js';
3
5
  import { QRPHDepositForm } from './QRPHDepositForm.js';
4
- import { QRPHDepositLoading } from './QRPHDepositLoading.js';
5
- import { QRPHDepositQrCode } from './QRPHDepositQrCode.js';
6
- import { QRPHDepositSuccess } from './QRPHDepositSuccess.js';
7
6
  import { useQRPHDeposit } from './useQRPHDeposit.js';
8
7
  export function QRPHDeposit() {
9
8
  const context = useQRPHDeposit();
10
- return (_jsxs(QRPHDepositContext, { value: context, children: [context.view === 'FORM' && _jsx(QRPHDepositForm, {}), context.view === 'LOADING' && _jsx(QRPHDepositLoading, {}), context.view === 'SUCCESS' && _jsx(QRPHDepositSuccess, {}), (context.view === 'QR_CODE' || context.view === 'VERIFYING') && (_jsx(QRPHDepositQrCode, {}))] }));
9
+ return (_jsxs(QRPHDepositContext, { value: context, children: [_jsx(QRPHDepositForm, {}), _jsx(QRPHDepositDetails, {}), _jsx(QRPHDepositAlert, {})] }));
11
10
  }
@@ -0,0 +1 @@
1
+ export declare function QRPHDepositAlert(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal } from '@ark-ui/react';
3
+ import { AlertCircleIcon, SpinnerIcon, XIcon } from '../../../../icons/index.js';
4
+ import { AlertDialog, Button } from '../../../../ui/index.js';
5
+ import { useQRPHDepositContext } from './QRPHDepositContext.js';
6
+ export function QRPHDepositAlert() {
7
+ const context = useQRPHDepositContext();
8
+ const details = useDetails();
9
+ return (_jsx(AlertDialog.Root, { open: context.status !== 'waiting' &&
10
+ context.status !== 'verification-waiting', onOpenChange: (details) => {
11
+ if (!details.open) {
12
+ context.reset();
13
+ }
14
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: details.type === 'loading', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [details.type === 'loading' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), details.type === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), details.type === 'erorr' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsx(AlertDialog.Title, { children: details.title }), _jsx(AlertDialog.Description, { children: details.description })] }), (details.type === 'erorr' || details.type === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
15
+ api.setOpen(false);
16
+ }, children: details.type === 'success' ? 'Ok' : 'Try Again' })) }) }))] }) })] }) }));
17
+ }
18
+ function useDetails() {
19
+ const context = useQRPHDepositContext();
20
+ const title = (() => {
21
+ let s = '';
22
+ if (context.status === 'processing') {
23
+ s = 'Processing Deposit';
24
+ }
25
+ else if (context.status === 'failed') {
26
+ s = 'Deposit Failed';
27
+ }
28
+ else if (context.status === 'verification-success') {
29
+ s = 'Deposit Successful';
30
+ }
31
+ else if (context.status === 'verification-processing') {
32
+ s = 'Verifying Deposit';
33
+ }
34
+ else if (context.status === 'verification-failed') {
35
+ if (context.deposit?.status === 'CANCELLED') {
36
+ s = 'Deposit Cancelled';
37
+ }
38
+ else if (context.deposit?.status === 'REJECTED') {
39
+ s = 'Deposit Rejected';
40
+ }
41
+ else {
42
+ s = 'Deposit Failed';
43
+ }
44
+ }
45
+ return s;
46
+ })();
47
+ const description = (() => {
48
+ let d = '';
49
+ if (context.status === 'processing') {
50
+ d = "We're verifying your account and amount. Please hold a moment.";
51
+ }
52
+ else if (context.status === 'failed') {
53
+ d =
54
+ 'Something went wrong while processing your deposit. ' +
55
+ 'Please try again or contact support.';
56
+ }
57
+ else if (context.status === 'verification-success') {
58
+ d = 'Your deposit has been successfully processed.';
59
+ }
60
+ else if (context.status === 'verification-processing') {
61
+ d = 'Your deposit is being processed.';
62
+ }
63
+ else if (context.status === 'verification-failed') {
64
+ if (context.deposit?.status === 'CANCELLED') {
65
+ d = 'Your deposit has been cancelled.';
66
+ }
67
+ else if (context.deposit?.status === 'REJECTED') {
68
+ d = 'Your deposit has been rejected.';
69
+ }
70
+ else if (context.deposit?.status === 'FAILED') {
71
+ d = context.deposit.error ?? 'Your deposit has failed.';
72
+ }
73
+ else {
74
+ d =
75
+ 'Something went wrong while processing your deposit. ' +
76
+ 'Please try again or contact support.';
77
+ }
78
+ }
79
+ return d;
80
+ })();
81
+ const type = (() => {
82
+ if (context.status === 'failed' ||
83
+ context.status === 'verification-failed') {
84
+ return 'erorr';
85
+ }
86
+ if (context.status === 'verification-success') {
87
+ return 'success';
88
+ }
89
+ return 'loading';
90
+ })();
91
+ return {
92
+ type,
93
+ title,
94
+ description,
95
+ };
96
+ }
@@ -1,24 +1,22 @@
1
1
  export declare const QRPHDepositContext: import("react").Context<{
2
- view: "LOADING" | "FORM" | "SUCCESS" | "QR_CODE" | "VERIFYING";
3
- qrCode: string | null;
2
+ view: "form" | "qrCode";
3
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
4
  verify: () => void;
5
- generateQrCode: import("@tanstack/react-query").UseMutateFunction<import("@opexa/portal-sdk-core").Deposit, Error, {
6
- amount: string;
7
- promo?: string | undefined;
8
- id?: string | undefined;
9
- }, unknown>;
10
- regenerateQrCode: () => void;
11
5
  reset: () => void;
6
+ deposit: import("@opexa/portal-sdk-core").Deposit | null;
7
+ generateQRCode: (input: {
8
+ amount: string;
9
+ promo?: string | null;
10
+ }) => void;
12
11
  } | null>;
13
12
  export declare const useQRPHDepositContext: () => {
14
- view: "LOADING" | "FORM" | "SUCCESS" | "QR_CODE" | "VERIFYING";
15
- qrCode: string | null;
13
+ view: "form" | "qrCode";
14
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
16
15
  verify: () => void;
17
- generateQrCode: import("@tanstack/react-query").UseMutateFunction<import("@opexa/portal-sdk-core").Deposit, Error, {
18
- amount: string;
19
- promo?: string | undefined;
20
- id?: string | undefined;
21
- }, unknown>;
22
- regenerateQrCode: () => void;
23
16
  reset: () => void;
17
+ deposit: import("@opexa/portal-sdk-core").Deposit | null;
18
+ generateQRCode: (input: {
19
+ amount: string;
20
+ promo?: string | null;
21
+ }) => void;
24
22
  };
@@ -0,0 +1 @@
1
+ export declare function QRPHDepositDetails(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal, QrCode } from '@ark-ui/react';
3
+ import Image from 'next/image';
4
+ import { QrCode02Icon, XIcon } from '../../../../icons/index.js';
5
+ import qrphIcon from '../../../../images/qrph-icon.png';
6
+ import { Button, Dialog } from '../../../../ui/index.js';
7
+ import { useQRPHDepositContext } from './QRPHDepositContext.js';
8
+ export function QRPHDepositDetails() {
9
+ const context = useQRPHDepositContext();
10
+ if (context.view !== 'qrCode')
11
+ return null;
12
+ return (_jsxs("div", { className: "bg-bg-primary-alt rounded-lg p-2xl", children: [_jsx("p", { className: "text-center text-lg font-semibold lg:text-xl", children: "QR Code" }), _jsx("p", { className: "text-text-secondary-700 mt-3 text-center text-sm lg:text-base", children: "Scan the QR code below with your banking app, or upload it to complete your deposit." }), _jsxs(QrCode.Root, { value: context.deposit?.qrCode ?? '', className: "border-border-primary bg-bg-brand-secondary-alt mx-auto mt-6 w-[12.5rem] rounded-lg border p-5 lg:w-[13rem] lg:p-6", children: [_jsxs("div", { className: "relative", children: [_jsx(QrCode.Frame, { className: "border-border-primary mx-auto size-[10rem] rounded-[0.25rem] border bg-white", children: _jsx(QrCode.Pattern, {}) }), _jsx(QrCode.Overlay, { className: "bg-white p-0.5", children: _jsx(Image, { src: qrphIcon, alt: "", className: "size-8", width: 40, height: 40 }) })] }), _jsx(QrCode.DownloadTrigger, { fileName: `qrcode-${new Date().getTime()}`, mimeType: "image/png", className: "text-text-secondary-700 mt-5 block w-full text-center text-sm font-semibold", children: "Download QR Code" })] }), _jsxs("div", { className: "mt-6 flex flex-col gap-4 lg:flex-row", children: [_jsx(Button, { size: "sm", variant: "outline", colorScheme: "gray", onClick: context.reset, children: "Generate New QR Code" }), _jsx(Button, { size: "sm", onClick: context.verify, children: "Confirm Deposit" })] }), _jsx(Instruction, {})] }));
13
+ }
14
+ function Instruction() {
15
+ return (_jsxs("p", { className: "text-text-tertiary-600 mt-6 text-center text-xs", children: ["Need help using the QR Code?", ' ', _jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, children: [_jsx(Dialog.Trigger, { className: "text-text-warning-primary-600", children: "See instructions" }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto w-[calc(100%-2rem)] rounded-lg p-4xl lg:w-[33.625rem]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(Dialog.Body, { children: [_jsxs("div", { className: "flex items-center gap-xl", children: [_jsx("div", { className: "border-border-primary shadow-xs text-gray-700 text-text-secondary-700 flex size-11 items-center justify-center rounded-lg border", children: _jsx(QrCode02Icon, { className: "size-6" }) }), _jsx(Dialog.Title, { className: "text-lg font-semibold", children: "How to Use the QR Code for Payment" })] }), _jsx(Dialog.Description, { className: "mt-5", children: "Follow these simple steps to complete your transaction:" }), _jsxs("ol", { className: "mt-3 list-inside list-decimal space-y-3", children: [_jsx("li", { children: "Open your preferred banking or EMI mobile app and select 'Transfer Money' or 'Pay via QR'" }), _jsx("li", { children: "Scan or upload the generated QR Ph code. If prompted by the app, enter the amount to be sent." }), _jsx("li", { children: "Proceed with the transfer or payment." })] })] })] }) })] })] })] }));
16
+ }
@@ -1 +1 @@
1
- export declare function QRPHDepositForm(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function QRPHDepositForm(): import("react/jsx-runtime").JSX.Element | null;
@@ -84,17 +84,9 @@ export function QRPHDepositForm() {
84
84
  });
85
85
  }
86
86
  }, [form, minimumAmount]);
87
- const handleSubmit = form.handleSubmit(async (data) => {
88
- context.generateQrCode({
89
- amount: data.amount.toString(),
90
- promo: data.promo ?? undefined,
91
- }, {
92
- onSuccess() {
93
- form.reset();
94
- },
95
- });
96
- });
97
- return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
87
+ if (context.view !== 'form')
88
+ return null;
89
+ return (_jsxs("form", { onSubmit: form.handleSubmit(context.generateQRCode), noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
98
90
  o.field.onChange(details.value);
99
91
  }, formatOptions: {
100
92
  maximumFractionDigits: 2,
@@ -1,15 +1,13 @@
1
- type View = 'FORM' | 'LOADING' | 'SUCCESS' | 'QR_CODE' | 'VERIFYING';
1
+ import type { Deposit } from '@opexa/portal-sdk-core';
2
2
  export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
3
3
  export declare function useQRPHDeposit(): {
4
- view: View;
5
- qrCode: string | null;
4
+ view: "form" | "qrCode";
5
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
- generateQrCode: import("@tanstack/react-query").UseMutateFunction<import("@opexa/portal-sdk-core").Deposit, Error, {
8
- amount: string;
9
- promo?: string | undefined;
10
- id?: string | undefined;
11
- }, unknown>;
12
- regenerateQrCode: () => void;
13
7
  reset: () => void;
8
+ deposit: Deposit | null;
9
+ generateQRCode: (input: {
10
+ amount: string;
11
+ promo?: string | null;
12
+ }) => void;
14
13
  };
15
- export {};
@@ -1,77 +1,60 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { useCreateQRPHDepositMutation, useDepositQuery, } from '../../../../client/hooks/index.js';
4
- import { toaster } from '../../../../client/utils/index.js';
5
4
  export function useQRPHDeposit() {
6
- const [view, setView] = useState('FORM');
7
- const [id, setId] = useState(null);
8
- const [promo, setPromo] = useState(null);
9
- const [amount, setAmount] = useState(null);
10
- const [qrCode, setQrCode] = useState(null);
5
+ const [deposit, setDeposit] = useState(null);
6
+ const [status, setStatus] = useState('waiting');
7
+ const view = status === 'verification-failed' ||
8
+ status === 'verification-waiting' ||
9
+ status === 'verification-success' ||
10
+ status === 'verification-processing'
11
+ ? 'qrCode'
12
+ : 'form';
11
13
  const mutation = useCreateQRPHDepositMutation({
14
+ onMutate() {
15
+ setStatus('processing');
16
+ },
12
17
  onSuccess(data) {
13
18
  invariant(data.qrCode);
14
- setId(data.id);
15
- setQrCode(data.qrCode);
16
- setView('QR_CODE');
17
- },
18
- onError(error) {
19
- setView('FORM');
20
- toaster.error({
21
- description: error.message,
22
- });
19
+ setStatus('verification-waiting');
20
+ setDeposit(data);
23
21
  },
24
- onMutate(data) {
25
- setId(null);
26
- setPromo(data.promo ?? null);
27
- setAmount(data.amount);
28
- setQrCode(null);
29
- setView('LOADING');
22
+ onError() {
23
+ setStatus('failed');
30
24
  },
31
25
  });
32
- const query = useDepositQuery(id ?? undefined, {
33
- enabled: !!id,
34
- refetchInterval: view === 'VERIFYING' ? 2500 : 5000,
26
+ const generateQRCode = (input) => mutation.mutate({
27
+ amount: input.amount,
28
+ promo: input.promo ?? undefined,
29
+ });
30
+ const query = useDepositQuery(deposit?.id, {
31
+ enabled: !!deposit,
32
+ refetchInterval: 5000,
35
33
  });
36
34
  useEffect(() => {
37
- if (query.data?.status === 'CONFIRMED' ||
38
- query.data?.status === 'APPROVED') {
39
- setView('SUCCESS');
35
+ if (query.data?.status === 'APPROVED' ||
36
+ query.data?.status === 'CONFIRMED') {
37
+ setStatus('verification-success');
38
+ }
39
+ if (query.data?.status === 'CANCELLED' ||
40
+ query.data?.status === 'REJECTED' ||
41
+ query.data?.status === 'FAILED') {
42
+ setStatus('verification-failed');
40
43
  }
41
44
  }, [query.data?.status]);
42
- const generateQrCode = mutation.mutate;
43
- const regenerateQrCode = () => {
44
- invariant(amount);
45
- mutation.mutate({
46
- amount: amount.toString(),
47
- promo: promo ?? undefined,
48
- });
45
+ const reset = () => {
46
+ setDeposit(null);
47
+ setStatus('waiting');
49
48
  };
50
49
  const verify = () => {
51
- setView('VERIFYING');
52
- };
53
- const reset = () => {
54
- setId(null);
55
- setPromo(null);
56
- setAmount(null);
57
- setQrCode(null);
58
- setView('FORM');
50
+ setStatus('verification-processing');
59
51
  };
60
- useEffect(() => {
61
- return () => {
62
- setId(null);
63
- setPromo(null);
64
- setAmount(null);
65
- setQrCode(null);
66
- setView('FORM');
67
- };
68
- }, []);
69
52
  return {
70
53
  view,
71
- qrCode,
54
+ status,
72
55
  verify,
73
- generateQrCode,
74
- regenerateQrCode,
75
56
  reset,
57
+ deposit,
58
+ generateQRCode,
76
59
  };
77
60
  }
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
+ import { twMerge } from 'tailwind-merge';
3
4
  import { useControllableState } from '../../client/hooks/index.js';
4
5
  import { CheckIcon } from '../../icons/index.js';
5
- import qrph from '../../images/QRPh.png';
6
+ import qrph from '../../images/QRPH.png';
6
7
  import gcash from '../../images/gcash.png';
7
8
  import instapay from '../../images/instapay.png';
8
9
  import maya from '../../images/maya.png';
@@ -55,5 +56,5 @@ export function PaymentMethods(props) {
55
56
  if (!lastValue)
56
57
  return;
57
58
  setValue(PaymentMethodDefinition.parse(lastValue));
58
- }, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "border-border-secondary ui-checked:border-border-brand-solid ui-checked:outline-solid ui-checked:outline-border-brand-solid flex cursor-pointer rounded-xl border p-xl ui-checked:outline", children: [_jsx("div", { className: "grow", children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: "h-5 w-auto lg:h-8", draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
59
+ }, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "border-border-secondary ui-checked:border-border-brand-solid flex cursor-pointer items-center justify-between rounded-xl border p-lg", children: [_jsx("div", { className: twMerge('rounded-xs bg-white px-sm py-[0.688rem]', option.value === 'GCASH' && 'bg-[#017EFF]'), children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: "h-[1.063rem] w-auto", draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
59
60
  }
@@ -1,33 +1,28 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal } from '@ark-ui/react';
2
3
  import { zodResolver } from '@hookform/resolvers/zod';
3
- import { useEffect } from 'react';
4
+ import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
6
- import { useShallow } from 'zustand/shallow';
7
- import { useCreateGCashWithdrawalMutation, useGlobalStore, useLocaleInfo, useMobileNumberParser, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
8
- import { toaster } from '../../../../client/utils/index.js';
9
- import { ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, } from '../../../../icons/index.js';
10
- import { Button, Field, NumberInput, PasswordInput } from '../../../../ui/index.js';
7
+ import { useCreateGCashWithdrawalMutation, useLocaleInfo, useMobileNumberParser, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
8
+ import { AlertCircleIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
9
+ import { AlertDialog, Button, Field, NumberInput, PasswordInput, } from '../../../../ui/index.js';
11
10
  import { parseDecimal } from '../../../../utils/index.js';
12
11
  import { AmountChoices } from '../../AmountChoices.js';
13
12
  export function GCashWithdrawal() {
14
- const globalStore = useGlobalStore(useShallow((ctx) => ({
15
- depositWithdrawal: ctx.depositWithdrawal,
16
- })));
13
+ const [status, setStatus] = useState('waiting');
17
14
  const localeInfo = useLocaleInfo();
18
15
  const mobileNumberParser = useMobileNumberParser();
19
16
  const createWithdrawalMutation = useCreateGCashWithdrawalMutation({
17
+ onMutate() {
18
+ setStatus('processing');
19
+ },
20
20
  onSuccess() {
21
+ setStatus('success');
21
22
  form.reset();
22
- globalStore.depositWithdrawal.setOpen(false);
23
- toaster.success({
24
- description: 'Withdrawal request submitted successfully.',
25
- });
26
23
  },
27
- onError(error) {
28
- toaster.error({
29
- description: error.message,
30
- });
24
+ onError() {
25
+ setStatus('failed');
31
26
  },
32
27
  });
33
28
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -101,5 +96,14 @@ export function GCashWithdrawal() {
101
96
  shouldDirty: true,
102
97
  shouldValidate: true,
103
98
  });
104
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: createWithdrawalMutation.isPending ? (_jsxs(_Fragment, { children: [_jsx(SpinnerIcon, {}), "Processing..."] })) : ('Deposit') })] }));
99
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
100
+ if (!details.open) {
101
+ setStatus('waiting');
102
+ }
103
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
104
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
105
+ 'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
106
+ 'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
107
+ api.setOpen(false);
108
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
105
109
  }
@@ -1,32 +1,26 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { createListCollection } from '@ark-ui/react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createListCollection, Portal } from '@ark-ui/react';
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
- import { useEffect, useMemo } from 'react';
4
+ import { useEffect, useMemo, useState } from 'react';
5
5
  import { Controller, useForm } from 'react-hook-form';
6
6
  import { z } from 'zod';
7
- import { useShallow } from 'zustand/shallow';
8
- import { useCreateInstapayWithdrawalMutation, useGlobalStore, useInstapayBankListQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
9
- import { toaster } from '../../../../client/utils/index.js';
10
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, } from '../../../../icons/index.js';
11
- import { Button, Field, NumberInput, PasswordInput, Select, } from '../../../../ui/index.js';
7
+ import { useCreateInstapayWithdrawalMutation, useInstapayBankListQuery, usePaymentSettingsQuery, } from '../../../../client/hooks/index.js';
8
+ import { AlertCircleIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, EyeIcon, EyeOffIcon, SpinnerIcon, XIcon, } from '../../../../icons/index.js';
9
+ import { AlertDialog, Button, Field, NumberInput, PasswordInput, Select, } from '../../../../ui/index.js';
12
10
  import { parseDecimal } from '../../../../utils/index.js';
13
11
  import { AmountChoices } from '../../AmountChoices.js';
14
12
  export function InstapayWithdrawal() {
15
- const globalStore = useGlobalStore(useShallow((ctx) => ({
16
- depositWithdrawal: ctx.depositWithdrawal,
17
- })));
13
+ const [status, setStatus] = useState('waiting');
18
14
  const createWithdrawalMutation = useCreateInstapayWithdrawalMutation({
15
+ onMutate() {
16
+ setStatus('processing');
17
+ },
19
18
  onSuccess() {
20
19
  form.reset();
21
- globalStore.depositWithdrawal.setOpen(false);
22
- toaster.success({
23
- description: 'Withdrawal request submitted successfully.',
24
- });
20
+ setStatus('success');
25
21
  },
26
- onError(error) {
27
- toaster.error({
28
- description: error.message,
29
- });
22
+ onError() {
23
+ setStatus('failed');
30
24
  },
31
25
  });
32
26
  const instapayBankListQuery = useInstapayBankListQuery();
@@ -124,5 +118,14 @@ export function InstapayWithdrawal() {
124
118
  shouldDirty: true,
125
119
  shouldValidate: true,
126
120
  });
127
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: createWithdrawalMutation.isPending ? (_jsxs(_Fragment, { children: [_jsx(SpinnerIcon, {}), "Processing..."] })) : ('Deposit') })] }));
121
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
122
+ if (!details.open) {
123
+ setStatus('waiting');
124
+ }
125
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "text-text-brand-primary-600 size-12" })), status === 'success' && (_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "bg-bg-error-secondary text-text-featured-icon-light-error flex size-12 items-center justify-center rounded-full", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
126
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
127
+ 'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
128
+ 'Something went wrong while processing your withdrawal. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
129
+ api.setOpen(false);
130
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
128
131
  }