@tap-payments/os-micro-frontend-shared 0.1.362-test.1 → 0.1.362-test.2

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.
@@ -8,6 +8,7 @@ import { changeDateTimezone } from '../../../../../utils/index.js';
8
8
  import { RefundStateIcon } from './RefundStateIcon';
9
9
  import { refundStatusLabels } from '../constant';
10
10
  import { RefundCellContainer, PartialIcon, PercentageContainer, DateContainer } from '../style';
11
+ import { useMemo } from 'react';
11
12
  export default function RefundStatus({ status, refundIcon, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }) {
12
13
  const theme = useTheme();
13
14
  const { t } = useTranslation();
@@ -15,6 +16,11 @@ export default function RefundStatus({ status, refundIcon, refundTooltip, refund
15
16
  currentTimezone: ACCEPTANCE_TIMEZONE,
16
17
  targetTimezone: timezone === null || timezone === void 0 ? void 0 : timezone.offset,
17
18
  });
19
+ const refundIconSrc = useMemo(() => {
20
+ if (refundIcon)
21
+ return refundIcon;
22
+ return status === 'REFUNDED' ? refundedIcon : refundSettledIcon;
23
+ }, [status, refundIcon]);
18
24
  if (!['REFUNDED', 'PAID_OUT'].includes(status !== null && status !== void 0 ? status : '')) {
19
25
  return (_jsx(RefundStateIcon, { status: status, refundTooltip: refundTooltip, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode }));
20
26
  }
@@ -27,7 +33,7 @@ export default function RefundStatus({ status, refundIcon, refundTooltip, refund
27
33
  })) }, { children: [_jsx(PartialIcon, { sx: Object.assign({}, (!date && {
28
34
  width: '16px',
29
35
  height: '16px',
30
- })), src: refundIcon || status === 'REFUNDED' ? refundedIcon : refundSettledIcon, alt: "refunded" }), _jsx(motion.div, Object.assign({ style: {
36
+ })), src: refundIconSrc, alt: "refunded" }), _jsx(motion.div, Object.assign({ style: {
31
37
  display: 'none',
32
38
  alignItems: 'center',
33
39
  justifyContent: 'center',
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.362-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.362-test.2",
5
+ "testVersion": 2,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",