@tap-payments/os-micro-frontend-shared 0.1.291-test.1-test.2-test.3-test.4-test.5 → 0.1.291-test.1-test.2-test.3-test.4-test.5-test.6
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.
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { AnimatePresence } from 'framer-motion';
|
|
4
3
|
import Tooltip from '../../../Tooltip';
|
|
5
|
-
import {
|
|
6
|
-
import { actionFailIcon, actionSuccessIcon, fileDownloadBlueIcon, fileDownloadGreyIcon } from '../../../../constants/index.js';
|
|
4
|
+
import { actionFailIcon, actionSuccessIcon, spinnerLoadingIcon, fileDownloadBlueIcon, fileDownloadGreyIcon } from '../../../../constants/index.js';
|
|
7
5
|
import { StyledDownloadFileImage, StyledDownloadFileImageWrapper } from './style';
|
|
8
6
|
export const PayoutReportCell = ({ onClick, isSettlementsAvailable, isDownloadError, isDownloadLoading, isDownloadSuccess }) => {
|
|
9
7
|
const isDownloadInProgress = useMemo(() => isDownloadLoading || isDownloadSuccess || isDownloadError, [isDownloadLoading, isDownloadSuccess, isDownloadError]);
|
|
10
8
|
const icon = useMemo(() => {
|
|
9
|
+
if (isDownloadLoading) {
|
|
10
|
+
return spinnerLoadingIcon;
|
|
11
|
+
}
|
|
11
12
|
if (isDownloadSuccess) {
|
|
12
13
|
return actionSuccessIcon;
|
|
13
14
|
}
|
|
@@ -15,6 +16,6 @@ export const PayoutReportCell = ({ onClick, isSettlementsAvailable, isDownloadEr
|
|
|
15
16
|
return actionFailIcon;
|
|
16
17
|
}
|
|
17
18
|
return fileDownloadBlueIcon;
|
|
18
|
-
}, [isDownloadSuccess, isDownloadError]);
|
|
19
|
-
return (_jsx(Tooltip, Object.assign({ title: !isSettlementsAvailable ? 'Pending' : '' }, { children: _jsx(StyledDownloadFileImageWrapper, Object.assign({ onClick: () => isSettlementsAvailable && !isDownloadInProgress && onClick() }, { children: _jsx(
|
|
19
|
+
}, [isDownloadLoading, isDownloadSuccess, isDownloadError]);
|
|
20
|
+
return (_jsx(Tooltip, Object.assign({ title: !isSettlementsAvailable ? 'Pending' : '' }, { children: _jsx(StyledDownloadFileImageWrapper, Object.assign({ onClick: () => isSettlementsAvailable && !isDownloadInProgress && onClick() }, { children: _jsx(StyledDownloadFileImage, { src: isSettlementsAvailable ? icon : fileDownloadGreyIcon, alt: "Download Report" }) })) })));
|
|
20
21
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.291-test.1-test.2-test.3-test.4-test.5",
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.291-test.1-test.2-test.3-test.4-test.5-test.6",
|
|
5
|
+
"testVersion": 6,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|