payment-kit 1.18.56 → 1.19.0

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 (129) hide show
  1. package/.eslintrc.js +6 -0
  2. package/blocklet.yml +1 -1
  3. package/package.json +57 -58
  4. package/src/components/actions.tsx +22 -9
  5. package/src/components/balance-list.tsx +40 -12
  6. package/src/components/collapse.tsx +22 -14
  7. package/src/components/copyable.tsx +8 -7
  8. package/src/components/currency.tsx +15 -7
  9. package/src/components/customer/actions.tsx +1 -5
  10. package/src/components/customer/form.tsx +3 -1
  11. package/src/components/customer/link.tsx +4 -12
  12. package/src/components/customer/notification-preference.tsx +18 -9
  13. package/src/components/customer/overdraft-protection.tsx +112 -41
  14. package/src/components/drawer-form.tsx +42 -18
  15. package/src/components/error.tsx +1 -5
  16. package/src/components/event/list.tsx +9 -10
  17. package/src/components/filter-toolbar.tsx +20 -19
  18. package/src/components/info-card.tsx +32 -18
  19. package/src/components/info-metric.tsx +16 -6
  20. package/src/components/info-row-group.tsx +1 -7
  21. package/src/components/info-row.tsx +30 -24
  22. package/src/components/invoice/action.tsx +1 -7
  23. package/src/components/invoice/list.tsx +15 -25
  24. package/src/components/invoice/recharge.tsx +5 -7
  25. package/src/components/invoice/table.tsx +17 -12
  26. package/src/components/layout/user.tsx +1 -1
  27. package/src/components/metadata/form.tsx +13 -13
  28. package/src/components/metadata/list.tsx +11 -3
  29. package/src/components/passport/actions.tsx +9 -4
  30. package/src/components/payment-currency/add.tsx +16 -3
  31. package/src/components/payment-currency/form.tsx +12 -6
  32. package/src/components/payment-intent/actions.tsx +24 -16
  33. package/src/components/payment-intent/list.tsx +11 -8
  34. package/src/components/payment-link/actions.tsx +1 -5
  35. package/src/components/payment-link/after-pay.tsx +4 -2
  36. package/src/components/payment-link/before-pay.tsx +14 -4
  37. package/src/components/payment-link/item.tsx +27 -6
  38. package/src/components/payment-link/preview.tsx +9 -9
  39. package/src/components/payment-link/product-select.tsx +17 -3
  40. package/src/components/payment-method/arcblock.tsx +6 -1
  41. package/src/components/payment-method/base.tsx +6 -1
  42. package/src/components/payment-method/bitcoin.tsx +6 -1
  43. package/src/components/payment-method/ethereum.tsx +6 -1
  44. package/src/components/payment-method/evm-rpc-input.tsx +11 -7
  45. package/src/components/payment-method/form.tsx +2 -7
  46. package/src/components/payouts/actions.tsx +1 -5
  47. package/src/components/payouts/list.tsx +11 -9
  48. package/src/components/payouts/portal/list.tsx +11 -9
  49. package/src/components/price/currency-select.tsx +28 -17
  50. package/src/components/price/form.tsx +135 -84
  51. package/src/components/price/upsell-select.tsx +10 -2
  52. package/src/components/price/upsell.tsx +7 -2
  53. package/src/components/pricing-table/actions.tsx +1 -5
  54. package/src/components/pricing-table/customer-settings.tsx +5 -1
  55. package/src/components/pricing-table/payment-settings.tsx +14 -4
  56. package/src/components/pricing-table/preview.tsx +9 -9
  57. package/src/components/pricing-table/price-item.tsx +6 -1
  58. package/src/components/pricing-table/product-item.tsx +6 -1
  59. package/src/components/pricing-table/product-settings.tsx +17 -4
  60. package/src/components/product/actions.tsx +1 -5
  61. package/src/components/product/create.tsx +1 -5
  62. package/src/components/product/cross-sell-select.tsx +5 -1
  63. package/src/components/product/cross-sell.tsx +7 -2
  64. package/src/components/product/features.tsx +13 -3
  65. package/src/components/product/form.tsx +38 -10
  66. package/src/components/progress-bar.tsx +1 -1
  67. package/src/components/refund/actions.tsx +1 -7
  68. package/src/components/refund/list.tsx +12 -17
  69. package/src/components/section/header.tsx +23 -12
  70. package/src/components/subscription/actions/cancel.tsx +22 -5
  71. package/src/components/subscription/actions/index.tsx +9 -10
  72. package/src/components/subscription/actions/pause.tsx +32 -6
  73. package/src/components/subscription/actions/slash-stake.tsx +5 -3
  74. package/src/components/subscription/description.tsx +12 -8
  75. package/src/components/subscription/items/index.tsx +30 -15
  76. package/src/components/subscription/items/usage-records.tsx +19 -5
  77. package/src/components/subscription/list.tsx +5 -7
  78. package/src/components/subscription/metrics.tsx +27 -12
  79. package/src/components/subscription/portal/actions.tsx +76 -70
  80. package/src/components/subscription/portal/cancel.tsx +10 -3
  81. package/src/components/subscription/portal/list.tsx +48 -26
  82. package/src/components/uploader.tsx +5 -13
  83. package/src/components/webhook/attempts.tsx +51 -16
  84. package/src/components/webhook/request-info.tsx +8 -6
  85. package/src/contexts/products.tsx +1 -1
  86. package/src/pages/admin/billing/invoices/detail.tsx +48 -12
  87. package/src/pages/admin/billing/subscriptions/detail.tsx +43 -11
  88. package/src/pages/admin/customers/customers/detail.tsx +53 -12
  89. package/src/pages/admin/customers/customers/index.tsx +6 -1
  90. package/src/pages/admin/developers/events/detail.tsx +36 -10
  91. package/src/pages/admin/developers/webhooks/detail.tsx +41 -11
  92. package/src/pages/admin/index.tsx +15 -2
  93. package/src/pages/admin/overview.tsx +107 -19
  94. package/src/pages/admin/payments/intents/detail.tsx +57 -13
  95. package/src/pages/admin/payments/payouts/detail.tsx +62 -14
  96. package/src/pages/admin/payments/refunds/detail.tsx +57 -13
  97. package/src/pages/admin/products/index.tsx +8 -2
  98. package/src/pages/admin/products/links/create.tsx +22 -4
  99. package/src/pages/admin/products/links/detail.tsx +42 -13
  100. package/src/pages/admin/products/passports/index.tsx +23 -4
  101. package/src/pages/admin/products/prices/actions.tsx +1 -6
  102. package/src/pages/admin/products/prices/detail.tsx +43 -11
  103. package/src/pages/admin/products/prices/list.tsx +7 -2
  104. package/src/pages/admin/products/pricing-tables/create.tsx +45 -12
  105. package/src/pages/admin/products/pricing-tables/detail.tsx +44 -13
  106. package/src/pages/admin/products/products/create.tsx +4 -1
  107. package/src/pages/admin/products/products/detail.tsx +72 -17
  108. package/src/pages/admin/settings/index.tsx +8 -1
  109. package/src/pages/admin/settings/payment-methods/index.tsx +84 -19
  110. package/src/pages/admin/settings/vault-config/edit-form.tsx +42 -28
  111. package/src/pages/admin/settings/vault-config/index.tsx +57 -10
  112. package/src/pages/customer/index.tsx +41 -15
  113. package/src/pages/customer/invoice/detail.tsx +63 -14
  114. package/src/pages/customer/invoice/past-due.tsx +11 -3
  115. package/src/pages/customer/payout/detail.tsx +56 -13
  116. package/src/pages/customer/recharge/account.tsx +80 -20
  117. package/src/pages/customer/recharge/subscription.tsx +86 -25
  118. package/src/pages/customer/refund/list.tsx +60 -24
  119. package/src/pages/customer/subscription/change-payment.tsx +13 -4
  120. package/src/pages/customer/subscription/change-plan.tsx +34 -7
  121. package/src/pages/customer/subscription/detail.tsx +86 -20
  122. package/src/pages/customer/subscription/embed.tsx +24 -4
  123. package/src/pages/home.tsx +26 -4
  124. package/src/pages/integrations/donations/edit-form.tsx +25 -9
  125. package/src/pages/integrations/donations/index.tsx +26 -9
  126. package/src/pages/integrations/donations/preview.tsx +59 -15
  127. package/src/pages/integrations/index.tsx +10 -1
  128. package/src/pages/integrations/overview.tsx +78 -17
  129. package/vite.config.ts +60 -30
@@ -254,12 +254,21 @@ export default function RechargePage() {
254
254
 
255
255
  return (
256
256
  <Root>
257
- <Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ position: 'relative' }}>
257
+ <Stack
258
+ direction="row"
259
+ sx={{
260
+ justifyContent: 'space-between',
261
+ alignItems: 'center',
262
+ position: 'relative',
263
+ }}>
258
264
  <Stack
259
265
  direction="row"
260
266
  onClick={() => goBackOrFallback('/customer')}
261
- alignItems="center"
262
- sx={{ fontWeight: 'normal', cursor: 'pointer' }}>
267
+ sx={{
268
+ alignItems: 'center',
269
+ fontWeight: 'normal',
270
+ cursor: 'pointer',
271
+ }}>
263
272
  <ArrowBackOutlined fontSize="small" sx={{ mr: 0.5, color: 'text.secondary' }} />
264
273
  <Typography variant="h6" sx={{ color: 'text.secondary', fontWeight: 'normal' }}>
265
274
  {t('common.previous')}
@@ -269,7 +278,6 @@ export default function RechargePage() {
269
278
  {t('customer.recharge.view')}
270
279
  </Button>
271
280
  </Stack>
272
-
273
281
  <Box>
274
282
  <Box
275
283
  sx={{
@@ -279,15 +287,26 @@ export default function RechargePage() {
279
287
  flexDirection: { xs: 'column', sm: 'column', md: 'row' },
280
288
  alignItems: { xs: 'flex-start', sm: 'flex-start', md: 'center' },
281
289
  }}>
282
- <Stack direction="row" justifyContent="space-between" alignItems="center">
283
- <Stack direction="row" alignItems="center" flexWrap="wrap" gap={1}>
290
+ <Stack
291
+ direction="row"
292
+ sx={{
293
+ justifyContent: 'space-between',
294
+ alignItems: 'center',
295
+ }}>
296
+ <Stack
297
+ direction="row"
298
+ sx={{
299
+ alignItems: 'center',
300
+ flexWrap: 'wrap',
301
+ gap: 1,
302
+ }}>
284
303
  <SubscriptionDescription subscription={subscription} variant="h1" />
285
304
  </Stack>
286
305
  </Stack>
287
306
  <Stack
288
- justifyContent="flex-start"
289
- flexWrap="wrap"
290
307
  sx={{
308
+ justifyContent: 'flex-start',
309
+ flexWrap: 'wrap',
291
310
  flexDirection: { xs: 'column', sm: 'column', md: 'row' },
292
311
  alignItems: { xs: 'flex-start', sm: 'flex-start', md: 'center' },
293
312
  gap: { xs: 1, sm: 1, md: 3 },
@@ -341,7 +360,6 @@ export default function RechargePage() {
341
360
  </Box>
342
361
  </Box>
343
362
  <Divider />
344
-
345
363
  <Box sx={{ maxWidth: 600 }} ref={rechargeRef}>
346
364
  <Typography variant="h4" gutterBottom>
347
365
  {t('customer.recharge.title')}
@@ -373,8 +391,16 @@ export default function RechargePage() {
373
391
  }
374
392
  : undefined,
375
393
  }}>
376
- <Stack direction="row" alignItems="center" spacing={1}>
377
- <Stack flex={1}>
394
+ <Stack
395
+ direction="row"
396
+ spacing={1}
397
+ sx={{
398
+ alignItems: 'center',
399
+ }}>
400
+ <Stack
401
+ sx={{
402
+ flex: 1,
403
+ }}>
378
404
  <Typography
379
405
  variant="body1"
380
406
  color="inherit"
@@ -402,7 +428,12 @@ export default function RechargePage() {
402
428
  <Stack sx={{ mb: 2, mt: 2, backgroundColor: 'background.default' }}>
403
429
  <Grid container spacing={2}>
404
430
  {presetAmounts.map(({ amount: presetAmount, cycles }) => (
405
- <Grid item xs={6} sm={4} key={presetAmount}>
431
+ <Grid
432
+ key={presetAmount}
433
+ size={{
434
+ xs: 6,
435
+ sm: 4,
436
+ }}>
406
437
  <Card
407
438
  variant="outlined"
408
439
  sx={{
@@ -421,7 +452,14 @@ export default function RechargePage() {
421
452
  : {}),
422
453
  }}>
423
454
  <CardActionArea onClick={() => handleSelect(presetAmount)} sx={{ height: '100%' }}>
424
- <Stack direction="column" sx={{ p: 1 }} spacing={1} alignItems="center" justifyContent="center">
455
+ <Stack
456
+ direction="column"
457
+ spacing={1}
458
+ sx={{
459
+ alignItems: 'center',
460
+ justifyContent: 'center',
461
+ p: 1,
462
+ }}>
425
463
  <Typography
426
464
  variant="h6"
427
465
  sx={{
@@ -430,7 +468,11 @@ export default function RechargePage() {
430
468
  }}>
431
469
  {presetAmount} {subscription.paymentCurrency.symbol}
432
470
  </Typography>
433
- <Typography variant="caption" color="text.secondary">
471
+ <Typography
472
+ variant="caption"
473
+ sx={{
474
+ color: 'text.secondary',
475
+ }}>
434
476
  {formatEstimatedDuration(cycles)}
435
477
  </Typography>
436
478
  </Stack>
@@ -438,7 +480,11 @@ export default function RechargePage() {
438
480
  </Card>
439
481
  </Grid>
440
482
  ))}
441
- <Grid item xs={6} sm={4}>
483
+ <Grid
484
+ size={{
485
+ xs: 6,
486
+ sm: 4,
487
+ }}>
442
488
  <Card
443
489
  variant="outlined"
444
490
  sx={{
@@ -455,7 +501,14 @@ export default function RechargePage() {
455
501
  ...(customAmount ? { borderColor: 'primary.main', borderWidth: 1 } : {}),
456
502
  }}>
457
503
  <CardActionArea onClick={handleCustomSelect} sx={{ height: '100%' }}>
458
- <Stack direction="column" sx={{ p: 1 }} spacing={1} alignItems="center" justifyContent="center">
504
+ <Stack
505
+ direction="column"
506
+ spacing={1}
507
+ sx={{
508
+ alignItems: 'center',
509
+ justifyContent: 'center',
510
+ p: 1,
511
+ }}>
459
512
  <Typography
460
513
  variant="h6"
461
514
  sx={{ fontWeight: 600, color: customAmount ? 'primary.main' : 'text.primary' }}>
@@ -479,19 +532,27 @@ export default function RechargePage() {
479
532
  error={!!amountError}
480
533
  helperText={amountError}
481
534
  onChange={handleAmountChange}
482
- InputProps={{
483
- endAdornment: <Typography>{subscription.paymentCurrency.symbol}</Typography>,
484
- autoComplete: 'off',
485
- inputProps: {
486
- min: 0,
487
- max: MAX_SAFE_AMOUNT,
488
- },
489
- }}
490
535
  sx={{ mt: 1 }}
491
536
  inputRef={customInputRef}
537
+ slotProps={{
538
+ input: {
539
+ endAdornment: <Typography>{subscription.paymentCurrency.symbol}</Typography>,
540
+ autoComplete: 'off',
541
+ inputProps: {
542
+ min: 0,
543
+ max: MAX_SAFE_AMOUNT,
544
+ },
545
+ },
546
+ }}
492
547
  />
493
548
  {amount && Number(amount) > 0 && Number(cycleAmount) > 0 && !amountError && (
494
- <Typography variant="body2" sx={{ color: 'text.lighter', mt: '8px !important' }} fontSize={12}>
549
+ <Typography
550
+ variant="body2"
551
+ sx={{
552
+ fontSize: 12,
553
+ color: 'text.lighter',
554
+ mt: '8px !important',
555
+ }}>
495
556
  {formatEstimatedDuration(
496
557
  Math.floor(Number(amount) / Number(cycleAmount)) < 1
497
558
  ? parseFloat((Number(amount) / Number(cycleAmount)).toFixed(1))
@@ -72,8 +72,12 @@ const RefundTable = memo(({ invoice_id }: Props) => {
72
72
  customBodyRenderLite: (_: string, index: number) => {
73
73
  const item = data.list[index] as TRefundExpanded;
74
74
  return (
75
- <Typography component="strong" fontWeight={600}>
76
- {formatBNStr(item?.amount, item?.paymentCurrency.decimal)}&nbsp;
75
+ <Typography
76
+ component="strong"
77
+ sx={{
78
+ fontWeight: 600,
79
+ }}>
80
+ {formatBNStr(item?.amount, item?.paymentCurrency.decimal)}
77
81
  {item?.paymentCurrency.symbol}
78
82
  </Typography>
79
83
  );
@@ -228,7 +232,14 @@ const RefundList = memo(({ invoice_id }: Props) => {
228
232
  }
229
233
 
230
234
  if (data && data.list.length === 0) {
231
- return <Typography color="text.secondary">{t('payment.customer.refund.empty')}</Typography>;
235
+ return (
236
+ <Typography
237
+ sx={{
238
+ color: 'text.secondary',
239
+ }}>
240
+ {t('payment.customer.refund.empty')}
241
+ </Typography>
242
+ );
232
243
  }
233
244
 
234
245
  const hasMore = data && data.list.length < data.count;
@@ -236,7 +247,12 @@ const RefundList = memo(({ invoice_id }: Props) => {
236
247
  const grouped = groupByDate(data.list);
237
248
 
238
249
  return (
239
- <Stack direction="column" gap={1} sx={{ mt: 1 }}>
250
+ <Stack
251
+ direction="column"
252
+ sx={{
253
+ gap: 1,
254
+ mt: 1,
255
+ }}>
240
256
  {Object.entries(grouped).map(([date, payments]) => (
241
257
  <Box key={date}>
242
258
  <Typography sx={{ fontWeight: 'bold', color: 'text.secondary', mt: 2, mb: 1 }}>{date}</Typography>
@@ -248,31 +264,53 @@ const RefundList = memo(({ invoice_id }: Props) => {
248
264
  xs: 'column',
249
265
  sm: 'row',
250
266
  }}
251
- sx={{ my: 1 }}
252
- gap={{
253
- xs: 0.5,
254
- sm: 1.5,
255
- md: 3,
256
- }}
257
- flexWrap="nowrap">
258
- <Box flex={3}>
267
+ sx={{
268
+ gap: {
269
+ xs: 0.5,
270
+ sm: 1.5,
271
+ md: 3,
272
+ },
273
+
274
+ flexWrap: 'nowrap',
275
+ my: 1,
276
+ }}>
277
+ <Box
278
+ sx={{
279
+ flex: 3,
280
+ }}>
259
281
  <Typography>{formatToDate(item.created_at)}</Typography>
260
282
  </Box>
261
- <Box flex={2}>
262
- <Typography textAlign="right">
283
+ <Box
284
+ sx={{
285
+ flex: 2,
286
+ }}>
287
+ <Typography
288
+ sx={{
289
+ textAlign: 'right',
290
+ }}>
263
291
  {formatBNStr(item.amount, item.paymentCurrency.decimal)}&nbsp;
264
292
  {item.paymentCurrency.symbol}
265
293
  </Typography>
266
294
  </Box>
267
- <Box flex={3}>
295
+ <Box
296
+ sx={{
297
+ flex: 3,
298
+ }}>
268
299
  <Status label={item.status} color={getPaymentIntentStatusColor(item.status)} />
269
300
  </Box>
270
- <Box flex={3}>
301
+ <Box
302
+ sx={{
303
+ flex: 3,
304
+ }}>
271
305
  <Typography>
272
306
  {item.description ? capitalize(toLower(item.description.replace(/_/g, ' '))) : '-'}
273
307
  </Typography>
274
308
  </Box>
275
- <Box flex={3} sx={{ minWidth: '220px' }}>
309
+ <Box
310
+ sx={{
311
+ flex: 3,
312
+ minWidth: '220px',
313
+ }}>
276
314
  {(item.payment_details?.arcblock?.tx_hash ||
277
315
  item.payment_details?.ethereum?.tx_hash ||
278
316
  item.payment_details?.base?.tx_hash) && (
@@ -293,7 +331,10 @@ const RefundList = memo(({ invoice_id }: Props) => {
293
331
  </Button>
294
332
  )}
295
333
  {!hasMore && data.count > pageSize && (
296
- <Typography color="text.secondary">
334
+ <Typography
335
+ sx={{
336
+ color: 'text.secondary',
337
+ }}>
297
338
  {t('common.noMore', { resource: t('payment.customer.payments') })}
298
339
  </Typography>
299
340
  )}
@@ -302,14 +343,9 @@ const RefundList = memo(({ invoice_id }: Props) => {
302
343
  );
303
344
  });
304
345
 
305
- export default function CustomerRefundList(props: Props & { type?: 'table' | 'list' }) {
306
- const { type, ...restProps } = props;
346
+ export default function CustomerRefundList({ type = 'list', ...restProps }: Props & { type?: 'table' | 'list' }) {
307
347
  if (type === 'table') {
308
348
  return <RefundTable {...restProps} />;
309
349
  }
310
350
  return <RefundList {...restProps} />;
311
351
  }
312
-
313
- CustomerRefundList.defaultProps = {
314
- type: 'list',
315
- };
@@ -224,12 +224,21 @@ function CustomerSubscriptionChangePayment({ subscription, customer, onComplete
224
224
 
225
225
  return (
226
226
  <Stack direction="column" spacing={4} sx={{ maxWidth: '540px' }}>
227
- <Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
227
+ <Stack
228
+ className="page-header"
229
+ direction="row"
230
+ sx={{
231
+ justifyContent: 'space-between',
232
+ alignItems: 'center',
233
+ }}>
228
234
  <Stack
229
235
  direction="row"
230
- alignItems="center"
231
- sx={{ fontWeight: 'normal', cursor: 'pointer' }}
232
- onClick={() => goBackOrFallback(`/customer/subscription/${subscription.id}`)}>
236
+ onClick={() => goBackOrFallback(`/customer/subscription/${subscription.id}`)}
237
+ sx={{
238
+ alignItems: 'center',
239
+ fontWeight: 'normal',
240
+ cursor: 'pointer',
241
+ }}>
233
242
  <ArrowBackOutlined fontSize="small" sx={{ mr: 0.5, color: 'text.secondary' }} />
234
243
  <SubscriptionDescription subscription={subscription} variant="h5" />
235
244
  </Stack>
@@ -219,7 +219,12 @@ export default function CustomerSubscriptionChangePlan() {
219
219
 
220
220
  const getInfoRow = (label: string, value: string, prefix?: string) => {
221
221
  return (
222
- <Stack direction="row" justifyContent="space-between" key={value}>
222
+ <Stack
223
+ direction="row"
224
+ key={value}
225
+ sx={{
226
+ justifyContent: 'space-between',
227
+ }}>
223
228
  <Typography variant="h6" sx={{ fontWeight: 'normal' }}>
224
229
  {label}
225
230
  </Typography>
@@ -233,12 +238,21 @@ export default function CustomerSubscriptionChangePlan() {
233
238
 
234
239
  return (
235
240
  <Stack direction="column" spacing={4} sx={{ mb: 4 }}>
236
- <Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
241
+ <Stack
242
+ className="page-header"
243
+ direction="row"
244
+ sx={{
245
+ justifyContent: 'space-between',
246
+ alignItems: 'center',
247
+ }}>
237
248
  <Stack
238
249
  direction="row"
239
- alignItems="center"
240
- sx={{ fontWeight: 'normal', cursor: 'pointer' }}
241
- onClick={() => goBackOrFallback(`/customer/subscription/${data.subscription.id}`)}>
250
+ onClick={() => goBackOrFallback(`/customer/subscription/${data.subscription.id}`)}
251
+ sx={{
252
+ alignItems: 'center',
253
+ fontWeight: 'normal',
254
+ cursor: 'pointer',
255
+ }}>
242
256
  <ArrowBackOutlined fontSize="small" sx={{ mr: 0.5, color: 'text.secondary' }} />
243
257
  <SubscriptionDescription subscription={data.subscription} variant="h5" />
244
258
  </Stack>
@@ -268,7 +282,13 @@ export default function CustomerSubscriptionChangePlan() {
268
282
  {state.items.map((x: TLineItemExpanded) => {
269
283
  const { product } = x.price;
270
284
  return (
271
- <Stack key={x.price_id} direction="row" alignItems="center" justifyContent="space-between">
285
+ <Stack
286
+ key={x.price_id}
287
+ direction="row"
288
+ sx={{
289
+ alignItems: 'center',
290
+ justifyContent: 'space-between',
291
+ }}>
272
292
  <InfoCard logo={product.images[0]} name={product.name} description={product.description} />
273
293
  <Typography component="p" style={{ fontWeight: 'bold' }}>
274
294
  {formatPrice(
@@ -294,7 +314,14 @@ export default function CustomerSubscriptionChangePlan() {
294
314
  <Divider />
295
315
  {getInfoRow(t('payment.customer.changePlan.remaining'), state.due)}
296
316
  <Divider />
297
- <Stack direction="row" alignItems="center" justifyContent="flex-end" spacing={2} sx={{ pt: 2 }}>
317
+ <Stack
318
+ direction="row"
319
+ spacing={2}
320
+ sx={{
321
+ alignItems: 'center',
322
+ justifyContent: 'flex-end',
323
+ pt: 2,
324
+ }}>
298
325
  <LoadingButton
299
326
  disabled={state.loading || state.paying}
300
327
  onClick={() => setState({ priceId: '' })}
@@ -100,7 +100,7 @@ export default function CustomerSubscriptionDetail() {
100
100
  }
101
101
  );
102
102
 
103
- const actionRef = useRef<ActionMethods>();
103
+ const actionRef = useRef<ActionMethods | undefined>(undefined);
104
104
 
105
105
  const enableOverdraftProtection = !!overdraftProtection?.enabled;
106
106
 
@@ -155,7 +155,12 @@ export default function CustomerSubscriptionDetail() {
155
155
  };
156
156
  if (!enabled) {
157
157
  return (
158
- <Stack direction="row" spacing={1} alignItems="center">
158
+ <Stack
159
+ direction="row"
160
+ spacing={1}
161
+ sx={{
162
+ alignItems: 'center',
163
+ }}>
159
164
  <Typography sx={{ color: 'text.lighter' }}>{t('customer.overdraftProtection.disabled')}</Typography>
160
165
  <Button
161
166
  size="small"
@@ -195,9 +200,23 @@ export default function CustomerSubscriptionDetail() {
195
200
  }
196
201
 
197
202
  return (
198
- <Stack direction="row" alignItems="center">
199
- <Stack direction="row" spacing={1} alignItems="center">
200
- <Stack direction="row" spacing={0.5} alignItems="center">
203
+ <Stack
204
+ direction="row"
205
+ sx={{
206
+ alignItems: 'center',
207
+ }}>
208
+ <Stack
209
+ direction="row"
210
+ spacing={1}
211
+ sx={{
212
+ alignItems: 'center',
213
+ }}>
214
+ <Stack
215
+ direction="row"
216
+ spacing={0.5}
217
+ sx={{
218
+ alignItems: 'center',
219
+ }}>
201
220
  <CheckCircle
202
221
  sx={{
203
222
  fontSize: '16px',
@@ -234,7 +253,11 @@ export default function CustomerSubscriptionDetail() {
234
253
  sx={{ width: 16, height: 16 }}
235
254
  alt={data.paymentCurrency?.symbol}
236
255
  />
237
- <Box display="flex" alignItems="baseline">
256
+ <Box
257
+ sx={{
258
+ display: 'flex',
259
+ alignItems: 'baseline',
260
+ }}>
238
261
  {formatBNStr(overdraftProtection?.unused, data.paymentCurrency.decimal)}
239
262
  <Typography
240
263
  sx={{
@@ -283,20 +306,29 @@ export default function CustomerSubscriptionDetail() {
283
306
  <Stack
284
307
  className="page-header"
285
308
  direction="row"
286
- justifyContent="space-between"
287
- alignItems="center"
288
- sx={{ position: 'relative' }}>
309
+ sx={{
310
+ justifyContent: 'space-between',
311
+ alignItems: 'center',
312
+ position: 'relative',
313
+ }}>
289
314
  <Stack
290
315
  direction="row"
291
316
  onClick={() => navigate('/customer', { replace: true })}
292
- alignItems="center"
293
- sx={{ fontWeight: 'normal', cursor: 'pointer' }}>
317
+ sx={{
318
+ alignItems: 'center',
319
+ fontWeight: 'normal',
320
+ cursor: 'pointer',
321
+ }}>
294
322
  <ArrowBackOutlined fontSize="small" sx={{ mr: 0.5, color: 'text.secondary' }} />
295
323
  <Typography variant="h6" sx={{ color: 'text.secondary', fontWeight: 'normal' }}>
296
324
  {t('payment.customer.subscriptions.title')}
297
325
  </Typography>
298
326
  </Stack>
299
- <Stack direction="row" gap={1}>
327
+ <Stack
328
+ direction="row"
329
+ sx={{
330
+ gap: 1,
331
+ }}>
300
332
  <SubscriptionActions
301
333
  subscription={data}
302
334
  onChange={(action) => {
@@ -332,45 +364,64 @@ export default function CustomerSubscriptionDetail() {
332
364
  </Stack>
333
365
  </Stack>
334
366
  <Box
335
- mt={4}
336
367
  sx={{
368
+ mt: 4,
337
369
  display: 'flex',
370
+
338
371
  gap: {
339
372
  xs: 2,
340
373
  sm: 2,
341
374
  md: 5,
342
375
  },
376
+
343
377
  flexWrap: 'wrap',
378
+
344
379
  flexDirection: {
345
380
  xs: 'column',
346
381
  sm: 'column',
347
382
  md: 'row',
348
383
  },
384
+
349
385
  alignItems: {
350
386
  xs: 'flex-start',
351
387
  sm: 'flex-start',
352
388
  md: 'center',
353
389
  },
354
390
  }}>
355
- <Stack direction="row" justifyContent="space-between" alignItems="center">
356
- <Stack direction="row" alignItems="center" flexWrap="wrap" gap={1}>
391
+ <Stack
392
+ direction="row"
393
+ sx={{
394
+ justifyContent: 'space-between',
395
+ alignItems: 'center',
396
+ }}>
397
+ <Stack
398
+ direction="row"
399
+ sx={{
400
+ alignItems: 'center',
401
+ flexWrap: 'wrap',
402
+ gap: 1,
403
+ }}>
357
404
  <SubscriptionDescription subscription={data} variant="h1" />
358
405
  </Stack>
359
406
  </Stack>
360
407
  <Stack
361
408
  className="section-body"
362
- justifyContent="flex-start"
363
- flexWrap="wrap"
364
409
  sx={{
410
+ justifyContent: 'flex-start',
411
+ flexWrap: 'wrap',
412
+
365
413
  'hr.MuiDivider-root:last-child': {
366
414
  display: 'none',
367
415
  },
416
+
368
417
  flexDirection: {
369
418
  xs: 'column',
370
419
  sm: 'column',
371
420
  md: 'row',
372
421
  },
422
+
373
423
  alignItems: 'flex-start',
424
+
374
425
  gap: {
375
426
  xs: 1,
376
427
  sm: 1,
@@ -381,7 +432,12 @@ export default function CustomerSubscriptionDetail() {
381
432
  {showOverdraftProtection && (
382
433
  <InfoMetric
383
434
  label={
384
- <Stack direction="row" alignItems="center" spacing={0.5}>
435
+ <Stack
436
+ direction="row"
437
+ spacing={0.5}
438
+ sx={{
439
+ alignItems: 'center',
440
+ }}>
385
441
  <Typography component="span">{t('customer.overdraftProtection.title')}</Typography>
386
442
  <MuiLink
387
443
  href="https://www.arcblock.io/content/blog/en/payment-kit-v117-sub-guard#listen-to-the-audio-overview"
@@ -440,7 +496,12 @@ export default function CustomerSubscriptionDetail() {
440
496
  </Box>
441
497
  <Divider />
442
498
  <Box className="section" sx={{ containerType: 'inline-size' }}>
443
- <Typography variant="h3" mb={3} className="section-header">
499
+ <Typography
500
+ variant="h3"
501
+ className="section-header"
502
+ sx={{
503
+ mb: 3,
504
+ }}>
444
505
  {t('admin.details')}
445
506
  </Typography>
446
507
  <InfoRowGroup
@@ -568,7 +629,12 @@ export default function CustomerSubscriptionDetail() {
568
629
  </Box>
569
630
  <Divider />
570
631
  <Box className="section">
571
- <Typography variant="h3" mb={1.5} className="section-header">
632
+ <Typography
633
+ variant="h3"
634
+ className="section-header"
635
+ sx={{
636
+ mb: 1.5,
637
+ }}>
572
638
  {t('admin.products')}
573
639
  </Typography>
574
640
  <Box className="section-body">