payment-kit 1.20.13 → 1.20.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.
@@ -16,7 +16,7 @@ import {
16
16
  PaymentBeneficiaries,
17
17
  useMobile,
18
18
  } from '@blocklet/payment-react';
19
- import type { TCheckoutSession, TInvoiceExpanded, TPaymentLink } from '@blocklet/payment-types';
19
+ import type { TCheckoutSession, TCreditGrantExpanded, TInvoiceExpanded, TPaymentLink } from '@blocklet/payment-types';
20
20
  import { ArrowBackOutlined } from '@mui/icons-material';
21
21
  import { Alert, Box, Button, CircularProgress, Divider, Stack, Tooltip, Typography, useTheme } from '@mui/material';
22
22
  import { styled } from '@mui/system';
@@ -36,11 +36,17 @@ import { goBackOrFallback } from '../../../libs/util';
36
36
  import CustomerRefundList from '../refund/list';
37
37
  import InfoMetric from '../../../components/info-metric';
38
38
  import InfoRowGroup from '../../../components/info-row-group';
39
+ import RelatedCreditGrants from '../../../components/customer/related-credit-grants';
39
40
 
40
41
  const fetchData = (
41
42
  id: string
42
43
  ): Promise<
43
- TInvoiceExpanded & { relatedInvoice?: TInvoiceExpanded; checkoutSession: TCheckoutSession; paymentLink: TPaymentLink }
44
+ TInvoiceExpanded & {
45
+ relatedInvoice?: TInvoiceExpanded;
46
+ checkoutSession: TCheckoutSession;
47
+ paymentLink: TPaymentLink;
48
+ relatedCreditGrants?: TCreditGrantExpanded[];
49
+ }
44
50
  > => {
45
51
  return api.get(`/api/invoices/${id}`).then((res) => res.data);
46
52
  };
@@ -426,6 +432,9 @@ export default function CustomerInvoiceDetail() {
426
432
  </Box>
427
433
  </>
428
434
  )}
435
+ {data?.relatedCreditGrants && data.relatedCreditGrants.length > 0 && (
436
+ <RelatedCreditGrants grants={data.relatedCreditGrants} />
437
+ )}
429
438
  {!isSlashStake && !isDonation && (
430
439
  <>
431
440
  {!isStake && (