@mx-cartographer/experiences 9.7.132 → 9.7.133
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [9.7.133] - 11-11-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Long merchant and account names in Recurring Transactions rows truncate with an ellipsis instead of overlapping the amount or frequency label, on the dashboard tile and the full widget (MEW-4028)
|
|
4
|
+
|
|
1
5
|
## [9.7.132] - 11-11-2026
|
|
2
6
|
|
|
3
7
|
- **FIXED** - The step chart's milestones and the emergency savings drawer's goal label use a thousands separator ($1,000), as the goal box beside them does, and a bar's screen-reader amount matches its visible one; every Insights V2 amount uses one of two named currency formats (WEC-2259)
|
|
@@ -4,27 +4,27 @@ import { useGlobalCopyStore as b, useRecurringTransactionsStore as D } from "../
|
|
|
4
4
|
import { RecurrenceStatus as a, RecurrenceType as x } from "../../core/types/RepeatingTransaction.es.js";
|
|
5
5
|
import { formatCurrency as L } from "../../core/utils/NumberFormatting.es.js";
|
|
6
6
|
import { getFrequencyLabel as h } from "../../core/utils/RecurringTransactionsUtil.es.js";
|
|
7
|
-
import { IncomeBadge as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { InstitutionLogo as
|
|
11
|
-
import { Cancel as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
var
|
|
18
|
-
if (t.type === x.Income) return /* @__PURE__ */ i(
|
|
7
|
+
import { IncomeBadge as G, MissedBadge as M, PaidBadge as v, UpcomingExpenseBadge as R } from "./RecurrenceBadges.es.js";
|
|
8
|
+
import S from "react";
|
|
9
|
+
import n from "@mui/material/Stack";
|
|
10
|
+
import { InstitutionLogo as _, MerchantLogo as A, Text as r } from "@mxenabled/mxui";
|
|
11
|
+
import { Cancel as k, CheckCircle as P } from "@mxenabled/mx-icons";
|
|
12
|
+
import { Fragment as B, jsx as i, jsxs as o } from "react/jsx-runtime";
|
|
13
|
+
import N from "@mui/material/ListItem";
|
|
14
|
+
import O from "@mui/material/ListItemAvatar";
|
|
15
|
+
import W from "@mui/material/ListItemButton";
|
|
16
|
+
import j from "@mui/material/ListItemText";
|
|
17
|
+
var F = (t) => {
|
|
18
|
+
if (t.type === x.Income) return /* @__PURE__ */ i(G, {});
|
|
19
19
|
switch (t.status) {
|
|
20
20
|
case a.Missed:
|
|
21
|
-
return /* @__PURE__ */ i(G, {});
|
|
22
|
-
case a.Paid:
|
|
23
21
|
return /* @__PURE__ */ i(M, {});
|
|
22
|
+
case a.Paid:
|
|
23
|
+
return /* @__PURE__ */ i(v, {});
|
|
24
24
|
default:
|
|
25
25
|
return /* @__PURE__ */ i(R, {});
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, U = (t, e) => {
|
|
28
28
|
switch (t.status) {
|
|
29
29
|
case a.Paid:
|
|
30
30
|
return t.expectedDate ? m(e.paid_on, c(t.occurredOnDate || t.expectedDate, l.MONTH_DAY)) : e.paid;
|
|
@@ -35,99 +35,109 @@ var U = (t) => {
|
|
|
35
35
|
default:
|
|
36
36
|
return e.unknown;
|
|
37
37
|
}
|
|
38
|
-
},
|
|
39
|
-
}, showOrdinal:
|
|
40
|
-
const { recurring:
|
|
41
|
-
let d =
|
|
42
|
-
return g ? d =
|
|
38
|
+
}, nt = ({ recurrence: t, isMini: e = !1, onRecurrenceClick: I = () => {
|
|
39
|
+
}, showOrdinal: C = !1 }) => {
|
|
40
|
+
const { recurring: s } = b(), { detailedRepeatingTransactions: p } = D(), u = S.useMemo(() => p.find((y) => y.guid === t.repeatingTransactionGuid), [t, p]), f = t.type === x.Income, T = t.status === a.Paid, g = t.status === a.Missed, w = t.status === a.Upcoming;
|
|
41
|
+
let d = s.paid?.toLowerCase();
|
|
42
|
+
return g ? d = s.missed?.toLowerCase() : w && (d = C ? h(s, u || {}, !0) : h(s, u || {}, !1)), /* @__PURE__ */ i(N, {
|
|
43
43
|
disableGutters: !0,
|
|
44
44
|
disablePadding: !0,
|
|
45
|
-
children: /* @__PURE__ */ o(
|
|
45
|
+
children: /* @__PURE__ */ o(W, {
|
|
46
46
|
onClick: () => {
|
|
47
|
-
|
|
47
|
+
I(t);
|
|
48
48
|
},
|
|
49
|
-
children: [/* @__PURE__ */ i(
|
|
49
|
+
children: [/* @__PURE__ */ i(O, { children: /* @__PURE__ */ i(A, {
|
|
50
50
|
categoryGuid: t.categoryGuid,
|
|
51
51
|
merchantGuid: t.merchantGuid || ""
|
|
52
|
-
}) }), /* @__PURE__ */ i(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
children: [/* @__PURE__ */ i(r, {
|
|
64
|
-
bold: !0,
|
|
65
|
-
variant: "body1",
|
|
66
|
-
children: t.name
|
|
67
|
-
}), /* @__PURE__ */ i(s, {
|
|
68
|
-
alignItems: "center",
|
|
69
|
-
direction: "row",
|
|
70
|
-
gap: 6,
|
|
71
|
-
children: e ? /* @__PURE__ */ o(s, {
|
|
72
|
-
direction: "row",
|
|
73
|
-
gap: 4,
|
|
74
|
-
children: [U(t), /* @__PURE__ */ i(r, {
|
|
75
|
-
variant: "caption",
|
|
76
|
-
children: z(t, n)
|
|
77
|
-
})]
|
|
78
|
-
}) : /* @__PURE__ */ o(P, { children: [t.institutionGuid && /* @__PURE__ */ i(S, {
|
|
79
|
-
alt: "",
|
|
80
|
-
institutionGuid: t.institutionGuid,
|
|
81
|
-
size: 12
|
|
82
|
-
}), /* @__PURE__ */ i(r, {
|
|
83
|
-
sx: { maxWidth: 250 },
|
|
84
|
-
variant: "caption",
|
|
85
|
-
children: t.institutionName
|
|
86
|
-
})] })
|
|
87
|
-
})]
|
|
88
|
-
}), /* @__PURE__ */ o(s, {
|
|
89
|
-
alignItems: "flex-end",
|
|
90
|
-
width: "100%",
|
|
91
|
-
children: [/* @__PURE__ */ o(r, {
|
|
92
|
-
bold: !0,
|
|
93
|
-
color: f ? "success.main" : "text.primary",
|
|
94
|
-
variant: "body1",
|
|
95
|
-
children: [f ? "+" : "", L(t.amount, "0,0.00")]
|
|
96
|
-
}), !e && /* @__PURE__ */ o(s, {
|
|
97
|
-
direction: "row",
|
|
52
|
+
}) }), /* @__PURE__ */ i(j, {
|
|
53
|
+
sx: { minWidth: 0 },
|
|
54
|
+
children: /* @__PURE__ */ o(n, {
|
|
55
|
+
direction: "row",
|
|
56
|
+
gap: 8,
|
|
57
|
+
sx: {
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
minWidth: 0
|
|
60
|
+
},
|
|
61
|
+
children: [/* @__PURE__ */ o(n, {
|
|
62
|
+
direction: "column",
|
|
98
63
|
sx: {
|
|
64
|
+
flex: 1,
|
|
65
|
+
minWidth: 64
|
|
66
|
+
},
|
|
67
|
+
children: [/* @__PURE__ */ i(r, {
|
|
68
|
+
bold: !0,
|
|
69
|
+
title: t.name,
|
|
70
|
+
truncate: !0,
|
|
71
|
+
variant: "body1",
|
|
72
|
+
children: t.name
|
|
73
|
+
}), /* @__PURE__ */ i(n, {
|
|
99
74
|
alignItems: "center",
|
|
75
|
+
direction: "row",
|
|
100
76
|
gap: 6,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
77
|
+
sx: { minWidth: 0 },
|
|
78
|
+
children: e ? /* @__PURE__ */ o(n, {
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
direction: "row",
|
|
81
|
+
gap: 4,
|
|
82
|
+
sx: { minWidth: 0 },
|
|
83
|
+
children: [F(t), /* @__PURE__ */ i(r, {
|
|
84
|
+
variant: "caption",
|
|
85
|
+
children: U(t, s)
|
|
86
|
+
})]
|
|
87
|
+
}) : /* @__PURE__ */ o(B, { children: [t.institutionGuid && /* @__PURE__ */ i(_, {
|
|
88
|
+
alt: "",
|
|
89
|
+
institutionGuid: t.institutionGuid,
|
|
109
90
|
size: 12
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
color: "error",
|
|
113
|
-
filled: !0,
|
|
114
|
-
size: 12
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ i(r, {
|
|
117
|
-
bold: !0,
|
|
118
|
-
color: "text.secondary",
|
|
91
|
+
}), /* @__PURE__ */ i(r, {
|
|
92
|
+
truncate: !0,
|
|
119
93
|
variant: "caption",
|
|
120
|
-
children:
|
|
121
|
-
})
|
|
122
|
-
]
|
|
94
|
+
children: t.institutionName
|
|
95
|
+
})] })
|
|
96
|
+
})]
|
|
97
|
+
}), /* @__PURE__ */ o(n, {
|
|
98
|
+
alignItems: "flex-end",
|
|
99
|
+
children: [/* @__PURE__ */ o(r, {
|
|
100
|
+
bold: !0,
|
|
101
|
+
color: f ? "success.main" : "text.primary",
|
|
102
|
+
sx: { whiteSpace: "nowrap" },
|
|
103
|
+
variant: "body1",
|
|
104
|
+
children: [f ? "+" : "", L(t.amount, "0,0.00")]
|
|
105
|
+
}), !e && /* @__PURE__ */ o(n, {
|
|
106
|
+
direction: "row",
|
|
107
|
+
sx: {
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
gap: 6,
|
|
110
|
+
justifyContent: "flex-end",
|
|
111
|
+
textAlign: "right",
|
|
112
|
+
textTransform: "uppercase"
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
T && /* @__PURE__ */ i(P, {
|
|
116
|
+
color: "success",
|
|
117
|
+
filled: !0,
|
|
118
|
+
size: 12
|
|
119
|
+
}),
|
|
120
|
+
g && /* @__PURE__ */ i(k, {
|
|
121
|
+
color: "error",
|
|
122
|
+
filled: !0,
|
|
123
|
+
size: 12
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ i(r, {
|
|
126
|
+
bold: !0,
|
|
127
|
+
color: "text.secondary",
|
|
128
|
+
variant: "caption",
|
|
129
|
+
children: d
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})]
|
|
123
133
|
})]
|
|
124
|
-
})
|
|
125
|
-
})
|
|
134
|
+
})
|
|
135
|
+
})]
|
|
126
136
|
})
|
|
127
137
|
});
|
|
128
138
|
};
|
|
129
139
|
export {
|
|
130
|
-
|
|
140
|
+
nt as RecurrenceRow
|
|
131
141
|
};
|
|
132
142
|
|
|
133
143
|
//# sourceMappingURL=RecurrenceRow.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurrenceRow.es.js","names":[],"sources":["../../../src/recurringtransactions/components/RecurrenceRow.tsx"],"sourcesContent":["import React from 'react'\n\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\n\nimport { CheckCircle, Cancel } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore, useRecurringTransactionsStore } from '../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport {\n type Recurrence,\n type RecurringCopy,\n RecurrenceStatus,\n RecurrenceType,\n RepeatingTransaction,\n} from '../../core'\n\nimport { getFrequencyLabel } from '../../core/utils/RecurringTransactionsUtil'\n\nimport { IncomeBadge, MissedBadge, PaidBadge, UpcomingExpenseBadge } from './RecurrenceBadges'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\n\nconst getStatusIcon = (recurrence: Recurrence): React.ReactNode => {\n if (recurrence.type === RecurrenceType.Income) {\n return <IncomeBadge />\n }\n\n switch (recurrence.status) {\n case RecurrenceStatus.Missed:\n return <MissedBadge />\n case RecurrenceStatus.Paid:\n return <PaidBadge />\n default:\n return <UpcomingExpenseBadge />\n }\n}\n\nconst getStatus = (recurrence: Recurrence, copy: RecurringCopy): string => {\n switch (recurrence.status) {\n case RecurrenceStatus.Paid:\n return recurrence.expectedDate\n ? (buildDynamicCopy(\n copy.paid_on,\n formatDate(\n recurrence.occurredOnDate || recurrence.expectedDate,\n DATE_FORMATS_INTL.MONTH_DAY,\n ),\n ) as string)\n : copy.paid\n case RecurrenceStatus.Missed:\n return buildDynamicCopy(\n copy.missed_on,\n formatDate(recurrence.expectedDate, DATE_FORMATS_INTL.MONTH_DAY),\n ) as string\n case RecurrenceStatus.Upcoming:\n return buildDynamicCopy(\n copy.upcoming_on,\n formatDate(recurrence.expectedDate, DATE_FORMATS_INTL.MONTH_DAY),\n ) as string\n default:\n return copy.unknown\n }\n}\n\ninterface RecurrenceRowProps {\n recurrence: Recurrence\n isMini?: boolean\n onRecurrenceClick?: (recurrence: Recurrence) => void\n showOrdinal?: boolean\n}\n\nexport const RecurrenceRow = ({\n recurrence,\n isMini = false,\n onRecurrenceClick = () => {},\n showOrdinal = false,\n}: RecurrenceRowProps) => {\n const { recurring: copy } = useGlobalCopyStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n\n const repeatingTransaction = React.useMemo(\n () =>\n detailedRepeatingTransactions.find((rt) => rt.guid === recurrence.repeatingTransactionGuid),\n [recurrence, detailedRepeatingTransactions],\n )\n\n const isCredit = recurrence.type === RecurrenceType.Income\n const isPaid = recurrence.status === RecurrenceStatus.Paid\n const isMissed = recurrence.status === RecurrenceStatus.Missed\n const isUpcoming = recurrence.status === RecurrenceStatus.Upcoming\n\n let statusLabel = copy.paid?.toLowerCase()\n if (isMissed) {\n statusLabel = copy.missed?.toLowerCase()\n } else if (isUpcoming) {\n statusLabel = showOrdinal\n ? getFrequencyLabel(copy, repeatingTransaction || ({} as RepeatingTransaction), true)\n : getFrequencyLabel(copy, repeatingTransaction || ({} as RepeatingTransaction), false)\n }\n\n const onItemClick = () => {\n onRecurrenceClick(recurrence)\n }\n\n return (\n //TODO: implement common/components/ListItemRow.tsx\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton onClick={onItemClick}>\n <ListItemAvatar>\n <MerchantLogo\n categoryGuid={recurrence.categoryGuid}\n merchantGuid={recurrence.merchantGuid || ''}\n />\n </ListItemAvatar>\n <ListItemText>\n <Stack\n direction=\"row\"\n gap={4}\n sx={{ justifyContent: 'space-between', textOverflow: 'ellipsis', textWrap: 'nowrap' }}\n >\n <Stack direction=\"column\" width=\"50%\">\n <Text bold={true} variant=\"body1\">\n {recurrence.name}\n </Text>\n <Stack alignItems=\"center\" direction=\"row\" gap={6}>\n {isMini ? (\n <Stack direction=\"row\" gap={4}>\n {getStatusIcon(recurrence)}\n <Text variant=\"caption\">{getStatus(recurrence, copy)}</Text>\n </Stack>\n ) : (\n <>\n {recurrence.institutionGuid && (\n <InstitutionLogo\n alt=\"\"\n institutionGuid={recurrence.institutionGuid}\n size={12}\n />\n )}\n <Text sx={{ maxWidth: 250 }} variant=\"caption\">\n {recurrence.institutionName}\n </Text>\n </>\n )}\n </Stack>\n </Stack>\n\n <Stack alignItems=\"flex-end\" width=\"100%\">\n <Text bold={true} color={isCredit ? 'success.main' : 'text.primary'} variant=\"body1\">\n {isCredit ? '+' : ''}\n {formatCurrency(recurrence.amount, '0,0.00')}\n </Text>\n {!isMini && (\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n gap: 6,\n justifyContent: 'flex-end',\n textTransform: 'uppercase',\n width: '100%',\n }}\n >\n {isPaid && <CheckCircle color=\"success\" filled={true} size={12} />}\n {isMissed && <Cancel color=\"error\" filled={true} size={12} />}\n <Text bold={true} color=\"text.secondary\" variant=\"caption\">\n {statusLabel}\n </Text>\n </Stack>\n )}\n </Stack>\n </Stack>\n </ListItemText>\n </ListItemButton>\n </ListItem>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAM,IAAA,CAAiB,MAA4C;AACjE,MAAI,EAAW,SAAS,EAAe,OACrC,QAAO,gBAAA,E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GAEH,gBAAA,EAAC,GAAD;AAAA,cAAM,IAAI,EAAE,UAAU,IAAI;AAAA,cAAG,SAAQ;AAAA,cAClC,UAAA,EAAW;AAAA,YACR,CAAA,CACN,EAAA,CAAA;AAAA,UAEC,CAAA,CACF;AAAA,QAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,UAAO,YAAW;AAAA,UAAW,OAAM;AAAA,UAAnC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YAAM,MAAM;AAAA,YAAM,OAAO,IAAW,iBAAiB;AAAA,YAAgB,SAAQ;AAAA,YAA7E,UAAA,CACG,IAAW,MAAM,IACjB,EAAe,EAAW,QAAQ,QAAQ,CACvC;AAAA,UACL,CAAA,GAAA,CAAC,KACA,gBAAA,EAAC,GAAD;AAAA,YACE,WAAU;AAAA,YACV,IAAI;AAAA,cACF,YAAY;AAAA,cACZ,KAAK;AAAA,cACL,gBAAgB;AAAA,cAChB,eAAe;AAAA,cACf,OAAO;AAAA,YACT;AAAA,YARF,UAAA;AAAA,cAUG,KAAU,gBAAA,EAAC,GAAD;AAAA,gBAAa,OAAM;AAAA,gBAAU,QAAQ;AAAA,gBAAM,MAAM;AAAA,cAAK,CAAA;AAAA,cAChE,KAAY,gBAAA,EAAC,GAAD;AAAA,gBAAQ,OAAM;AAAA,gBAAQ,QAAQ;AAAA,gBAAM,MAAM;AAAA,cAAK,CAAA;AAAA,cAC5D,gBAAA,EAAC,GAAD;AAAA,gBAAM,MAAM;AAAA,gBAAM,OAAM;AAAA,gBAAiB,SAAQ;AAAA,gBAC9C,UAAA;AAAA,cACG,CAAA;AAAA,YACD;AAAA,UAEJ,CAAA,CAAA;AAAA,QACF,CAAA,CAAA;AAAA,MACK,CAAA,EAAA,CAAA,CACA;AAAA;EACR,CAAA;AAEd"}
|
|
1
|
+
{"version":3,"file":"RecurrenceRow.es.js","names":[],"sources":["../../../src/recurringtransactions/components/RecurrenceRow.tsx"],"sourcesContent":["import React from 'react'\n\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\n\nimport { CheckCircle, Cancel } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore, useRecurringTransactionsStore } from '../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport {\n type Recurrence,\n type RecurringCopy,\n RecurrenceStatus,\n RecurrenceType,\n RepeatingTransaction,\n} from '../../core'\n\nimport { getFrequencyLabel } from '../../core/utils/RecurringTransactionsUtil'\n\nimport { IncomeBadge, MissedBadge, PaidBadge, UpcomingExpenseBadge } from './RecurrenceBadges'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\n\nconst getStatusIcon = (recurrence: Recurrence): React.ReactNode => {\n if (recurrence.type === RecurrenceType.Income) {\n return <IncomeBadge />\n }\n\n switch (recurrence.status) {\n case RecurrenceStatus.Missed:\n return <MissedBadge />\n case RecurrenceStatus.Paid:\n return <PaidBadge />\n default:\n return <UpcomingExpenseBadge />\n }\n}\n\nconst getStatus = (recurrence: Recurrence, copy: RecurringCopy): string => {\n switch (recurrence.status) {\n case RecurrenceStatus.Paid:\n return recurrence.expectedDate\n ? (buildDynamicCopy(\n copy.paid_on,\n formatDate(\n recurrence.occurredOnDate || recurrence.expectedDate,\n DATE_FORMATS_INTL.MONTH_DAY,\n ),\n ) as string)\n : copy.paid\n case RecurrenceStatus.Missed:\n return buildDynamicCopy(\n copy.missed_on,\n formatDate(recurrence.expectedDate, DATE_FORMATS_INTL.MONTH_DAY),\n ) as string\n case RecurrenceStatus.Upcoming:\n return buildDynamicCopy(\n copy.upcoming_on,\n formatDate(recurrence.expectedDate, DATE_FORMATS_INTL.MONTH_DAY),\n ) as string\n default:\n return copy.unknown\n }\n}\n\ninterface RecurrenceRowProps {\n recurrence: Recurrence\n isMini?: boolean\n onRecurrenceClick?: (recurrence: Recurrence) => void\n showOrdinal?: boolean\n}\n\nexport const RecurrenceRow = ({\n recurrence,\n isMini = false,\n onRecurrenceClick = () => {},\n showOrdinal = false,\n}: RecurrenceRowProps) => {\n const { recurring: copy } = useGlobalCopyStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n\n const repeatingTransaction = React.useMemo(\n () =>\n detailedRepeatingTransactions.find((rt) => rt.guid === recurrence.repeatingTransactionGuid),\n [recurrence, detailedRepeatingTransactions],\n )\n\n const isCredit = recurrence.type === RecurrenceType.Income\n const isPaid = recurrence.status === RecurrenceStatus.Paid\n const isMissed = recurrence.status === RecurrenceStatus.Missed\n const isUpcoming = recurrence.status === RecurrenceStatus.Upcoming\n\n let statusLabel = copy.paid?.toLowerCase()\n if (isMissed) {\n statusLabel = copy.missed?.toLowerCase()\n } else if (isUpcoming) {\n statusLabel = showOrdinal\n ? getFrequencyLabel(copy, repeatingTransaction || ({} as RepeatingTransaction), true)\n : getFrequencyLabel(copy, repeatingTransaction || ({} as RepeatingTransaction), false)\n }\n\n const onItemClick = () => {\n onRecurrenceClick(recurrence)\n }\n\n return (\n //TODO: implement common/components/ListItemRow.tsx\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton onClick={onItemClick}>\n <ListItemAvatar>\n <MerchantLogo\n categoryGuid={recurrence.categoryGuid}\n merchantGuid={recurrence.merchantGuid || ''}\n />\n </ListItemAvatar>\n <ListItemText sx={{ minWidth: 0 }}>\n <Stack direction=\"row\" gap={8} sx={{ justifyContent: 'space-between', minWidth: 0 }}>\n <Stack direction=\"column\" sx={{ flex: 1, minWidth: 64 }}>\n <Text bold={true} title={recurrence.name} truncate={true} variant=\"body1\">\n {recurrence.name}\n </Text>\n <Stack alignItems=\"center\" direction=\"row\" gap={6} sx={{ minWidth: 0 }}>\n {isMini ? (\n <Stack alignItems=\"center\" direction=\"row\" gap={4} sx={{ minWidth: 0 }}>\n {getStatusIcon(recurrence)}\n <Text variant=\"caption\">{getStatus(recurrence, copy)}</Text>\n </Stack>\n ) : (\n <>\n {recurrence.institutionGuid && (\n <InstitutionLogo\n alt=\"\"\n institutionGuid={recurrence.institutionGuid}\n size={12}\n />\n )}\n <Text truncate={true} variant=\"caption\">\n {recurrence.institutionName}\n </Text>\n </>\n )}\n </Stack>\n </Stack>\n\n <Stack alignItems=\"flex-end\">\n <Text\n bold={true}\n color={isCredit ? 'success.main' : 'text.primary'}\n sx={{ whiteSpace: 'nowrap' }}\n variant=\"body1\"\n >\n {isCredit ? '+' : ''}\n {formatCurrency(recurrence.amount, '0,0.00')}\n </Text>\n {!isMini && (\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n gap: 6,\n justifyContent: 'flex-end',\n textAlign: 'right',\n textTransform: 'uppercase',\n }}\n >\n {isPaid && <CheckCircle color=\"success\" filled={true} size={12} />}\n {isMissed && <Cancel color=\"error\" filled={true} size={12} />}\n <Text bold={true} color=\"text.secondary\" variant=\"caption\">\n {statusLabel}\n </Text>\n </Stack>\n )}\n </Stack>\n </Stack>\n </ListItemText>\n </ListItemButton>\n </ListItem>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAM,IAAA,CAAiB,MAA4C;AACjE,MAAI,EAAW,SAAS,EAAe,OACrC,QAAO,gBAAA,EAAC,GAAD,CAAc,CAAA;AAGvB,UAAQ,EAAW,QAAnB;AAAA,IACE,KAAK,EAAiB;AACpB,aAAO,gBAAA,EAAC,GAAD,CAAc,CAAA;AAAA,IACvB,KAAK,EAAiB;AACpB,aAAO,gBAAA,EAAC,GAAD,CAAY,CAAA;AAAA,IACrB;AACE,aAAO,gBAAA,EAAC,GAAD,CAAuB,CAAA;AAAA,EAClC;AACF,GAEM,IAAA,CAAa,GAAwB,MAAgC;AACzE,UAAQ,EAAW,QAAnB;AAAA,IACE,KAAK,EAAiB;AACpB,aAAO,EAAW,eACb,EACC,EAAK,SACL,E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