@opexa/portal-components 0.0.646 → 0.0.647

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.
@@ -21,6 +21,26 @@ import { formatNumber } from '../../utils/formatNumber.js';
21
21
  import { Empty } from '../shared/Empty.js';
22
22
  import { TableFilters } from './TableFilters.js';
23
23
  import { useTransactionPropsContext } from './TransactionContext.js';
24
+ /**
25
+ * Maps deposit type strings to required/preferred display names.
26
+ *
27
+ * Usage:
28
+ * - Add new mappings to the typeMapping object below
29
+ * - All mapped values will be capitalized using the capitalize function
30
+ * - Unmapped types will fall back to capitalized underscore-delimited format
31
+ *
32
+ * Examples:
33
+ * - 'PISOPAY_CHECKOUT' → 'Pisopay'
34
+ * - 'GCASH_DIRECT' → 'Gcash' (if added to mapping)
35
+ * - 'UNMAPPED_TYPE' → 'Unmapped Type' (fallback)
36
+ */
37
+ const getDepositTypeDisplayName = (type) => {
38
+ const typeMapping = {
39
+ 'PISOPAY_CHECKOUT': 'PISOPAY',
40
+ };
41
+ const displayValue = typeMapping[type] || type;
42
+ return capitalize(displayValue, { delimiter: capitalize.delimiters.UNDERSCORE });
43
+ };
24
44
  export function DepositRecordsTable(props) {
25
45
  const router = useRouter();
26
46
  const pathname = usePathname();
@@ -93,9 +113,7 @@ export function DepositRecordsTable(props) {
93
113
  depositStatus: true,
94
114
  } }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
95
115
  ? 'Fetching latest deposit records...'
96
- : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: twMerge('scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-track:bg-transparent lg:rounded-t-xl', classNames.scrollbarThumb || 'scrollbar-thumb:bg-bg-quaternary'), children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Deposit No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Deposit Method" }), _jsx(Table.Heading, { children: "Applied Amount" }), _jsx(Table.Heading, { children: "Received Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Deposit Time" }), _jsx(Table.Heading, { children: "Received Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.depositNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
97
- delimiter: capitalize.delimiters.UNDERSCORE,
98
- }) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.amount, {
116
+ : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: twMerge('scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-track:bg-transparent lg:rounded-t-xl', classNames.scrollbarThumb || 'scrollbar-thumb:bg-bg-quaternary'), children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Deposit No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Deposit Method" }), _jsx(Table.Heading, { children: "Applied Amount" }), _jsx(Table.Heading, { children: "Received Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Deposit Time" }), _jsx(Table.Heading, { children: "Received Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.depositNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: getDepositTypeDisplayName(data.type) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.amount, {
99
117
  currency: localeInfo.currency.code,
100
118
  minDecimalPlaces: 2,
101
119
  }) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.netAmount, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.646",
3
+ "version": "0.0.647",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",