@burdenoff/microfe-billing 2026.830.1 → 2026.830.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.
@@ -1,43 +1,40 @@
1
- import { StatusPill as e } from "../../../shared/ui/StatusPill.js";
1
+ import { useTr as e } from "../../../shared/hooks/useTr.js";
2
+ import { StatusPill as t } from "../../../shared/ui/StatusPill.js";
2
3
  import "../../../shared/ui/index.js";
3
- import { formatCurrency as t, formatDate as n, formatInvoiceNumber as r, formatInvoiceStatus as i } from "../../../shared/utils/format.js";
4
- import { getInvoiceStatusColor as a } from "../../../shared/utils/status.js";
5
- import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
6
- import { useGetBillingAccountsByOrgQuery as s } from "../../../../generated/global-operations.js";
7
- import { useBillingNavigate as c } from "../../../hooks/useBillingNavigate.js";
8
- import { withBillingAccountId as l } from "../../../shared/utils/navigation.js";
9
- import { usePaginatedInvoices as u } from "../hooks/useInvoices.js";
10
- import { useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
11
- import { RotateCcw as h } from "lucide-react";
12
- import { useSearchParams as g } from "react-router";
13
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
4
+ import { formatCurrency as n, formatDate as r, formatInvoiceNumber as i, formatInvoiceStatus as a } from "../../../shared/utils/format.js";
5
+ import { getInvoiceStatusColor as o } from "../../../shared/utils/status.js";
6
+ import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions.js";
7
+ import { useGetBillingAccountsByOrgQuery as c } from "../../../../generated/global-operations.js";
8
+ import { useBillingNavigate as l } from "../../../hooks/useBillingNavigate.js";
9
+ import { withBillingAccountId as u } from "../../../shared/utils/navigation.js";
10
+ import { usePaginatedInvoices as d } from "../hooks/useInvoices.js";
11
+ import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
12
+ import { RotateCcw as g } from "lucide-react";
13
+ import { useSearchParams as _ } from "react-router";
14
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
15
15
  import { IllustratedEmptyState as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
16
16
  //#region src/billing/modules/billing/pages/InvoicesListPage.tsx
17
17
  var C = () => {
18
- let { t: e } = b(), t = (t, n) => {
19
- let r = e(t);
20
- return r === t ? n : r;
21
- }, n = c(), r = o(), [a] = g(), C = a.get("billingAccountId") ?? void 0, { data: T } = s({ fetchPolicy: "cache-first" }), E = f(() => T?.getBillingAccountsByOrg ?? [], [T]), [D, O] = m(C);
22
- d(() => {
23
- O(C);
24
- }, [C]);
25
- let k = f(() => (E.find((e) => e.isDefault) ?? E[0])?.id ?? void 0, [E]), A = D === void 0 ? k ?? null : D, [j, M] = m("all"), [N, P] = m(""), [F, I] = m(""), [L, R] = m(1), z = p(null);
26
- d(() => (z.current && clearTimeout(z.current), z.current = setTimeout(() => {
27
- I(N), R(1);
18
+ let t = e(), n = l(), r = s(), [i] = _(), o = i.get("billingAccountId") ?? void 0, { data: C } = c({ fetchPolicy: "cache-first" }), T = p(() => C?.getBillingAccountsByOrg ?? [], [C]), [E, D] = h(o);
19
+ f(() => {
20
+ D(o);
21
+ }, [o]);
22
+ let O = p(() => (T.find((e) => e.isDefault) ?? T[0])?.id ?? void 0, [T]), k = E === void 0 ? O ?? null : E, [A, j] = h("all"), [M, N] = h(""), [P, F] = h(""), [I, L] = h(1), R = m(null);
23
+ f(() => (R.current && clearTimeout(R.current), R.current = setTimeout(() => {
24
+ F(M), L(1);
28
25
  }, 400), () => {
29
- z.current && clearTimeout(z.current);
30
- }), [N]);
31
- let { invoices: B, totalPages: V, isLoading: H, error: U, refetch: W } = u({
32
- billingAccountId: A ?? void 0,
33
- status: j === "all" ? void 0 : j,
34
- search: F || void 0,
35
- page: L,
26
+ R.current && clearTimeout(R.current);
27
+ }), [M]);
28
+ let { invoices: z, totalPages: B, isLoading: V, error: H, refetch: U } = d({
29
+ billingAccountId: k ?? void 0,
30
+ status: A === "all" ? void 0 : A,
31
+ search: P || void 0,
32
+ page: I,
36
33
  pageSize: 20
37
34
  });
38
- return r.canViewInvoices ? H && B.length === 0 ? /* @__PURE__ */ y("div", {
35
+ return r.canViewInvoices ? V && z.length === 0 ? /* @__PURE__ */ b("div", {
39
36
  className: "space-y-6 p-6",
40
- children: [/* @__PURE__ */ v("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", {
37
+ children: [/* @__PURE__ */ y("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", {
41
38
  className: "space-y-3",
42
39
  children: [
43
40
  1,
@@ -45,30 +42,30 @@ var C = () => {
45
42
  3,
46
43
  4,
47
44
  5
48
- ].map((e) => /* @__PURE__ */ v("div", {
45
+ ].map((e) => /* @__PURE__ */ y("div", {
49
46
  className: "border border-border-subtle rounded-lg p-4",
50
- children: /* @__PURE__ */ y("div", {
47
+ children: /* @__PURE__ */ b("div", {
51
48
  className: "flex items-center gap-4",
52
- children: [/* @__PURE__ */ v("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", {
49
+ children: [/* @__PURE__ */ y("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ b("div", {
53
50
  className: "flex-1 space-y-2",
54
- children: [/* @__PURE__ */ v("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
51
+ children: [/* @__PURE__ */ y("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
55
52
  })]
56
53
  })
57
54
  }, e))
58
55
  })]
59
- }) : U ? /* @__PURE__ */ v("div", {
56
+ }) : H ? /* @__PURE__ */ y("div", {
60
57
  className: "flex items-center justify-center h-full min-h-[400px]",
61
- children: /* @__PURE__ */ y("div", {
58
+ children: /* @__PURE__ */ b("div", {
62
59
  className: "text-center space-y-4",
63
60
  children: [
64
- /* @__PURE__ */ v("div", {
61
+ /* @__PURE__ */ y("div", {
65
62
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
66
- children: /* @__PURE__ */ v("svg", {
63
+ children: /* @__PURE__ */ y("svg", {
67
64
  className: "size-6 text-status-error-text",
68
65
  fill: "none",
69
66
  viewBox: "0 0 24 24",
70
67
  stroke: "currentColor",
71
- children: /* @__PURE__ */ v("path", {
68
+ children: /* @__PURE__ */ y("path", {
72
69
  strokeLinecap: "round",
73
70
  strokeLinejoin: "round",
74
71
  strokeWidth: 2,
@@ -76,70 +73,70 @@ var C = () => {
76
73
  })
77
74
  })
78
75
  }),
79
- /* @__PURE__ */ v("h2", {
76
+ /* @__PURE__ */ y("h2", {
80
77
  className: "text-lg font-semibold text-text-primary",
81
78
  children: t("billing.invoices.failedToLoad", "Failed to load invoices")
82
79
  }),
83
- /* @__PURE__ */ v("p", {
80
+ /* @__PURE__ */ y("p", {
84
81
  className: "text-sm text-text-secondary",
85
- children: U.message
82
+ children: H.message
86
83
  }),
87
- /* @__PURE__ */ v("button", {
84
+ /* @__PURE__ */ y("button", {
88
85
  type: "button",
89
- onClick: () => W(),
86
+ onClick: () => U(),
90
87
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
91
- children: "Try Again"
88
+ children: t("billing.common.tryAgain", "Try Again")
92
89
  })
93
90
  ]
94
91
  })
95
- }) : /* @__PURE__ */ y("div", {
92
+ }) : /* @__PURE__ */ b("div", {
96
93
  className: "space-y-6 px-6 lg:px-8 py-6",
97
94
  children: [
98
- /* @__PURE__ */ y("div", {
95
+ /* @__PURE__ */ b("div", {
99
96
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
100
- children: [/* @__PURE__ */ y("div", { children: [
101
- /* @__PURE__ */ v("h1", {
97
+ children: [/* @__PURE__ */ b("div", { children: [
98
+ /* @__PURE__ */ y("h1", {
102
99
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
103
100
  children: t("billing.invoices.title", "Invoices")
104
101
  }),
105
- /* @__PURE__ */ v("p", {
102
+ /* @__PURE__ */ y("p", {
106
103
  className: "text-sm text-text-secondary mt-1",
107
104
  children: t("billing.invoices.subtitle", "View and manage your billing invoices")
108
105
  }),
109
- /* @__PURE__ */ v(S, {
106
+ /* @__PURE__ */ y(S, {
110
107
  className: "mt-3",
111
108
  children: t("billing.invoices.purpose", "A record of everything you have been billed for — subscriptions, add-ons and one-off charges. Open an invoice to see line items, download the PDF, pay an outstanding amount, or request a refund.")
112
109
  })
113
- ] }), /* @__PURE__ */ y("div", {
110
+ ] }), /* @__PURE__ */ b("div", {
114
111
  className: "flex items-center gap-3",
115
- children: [/* @__PURE__ */ y("button", {
112
+ children: [/* @__PURE__ */ b("button", {
116
113
  type: "button",
117
114
  onClick: () => n("/refunds"),
118
115
  className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
119
- children: [/* @__PURE__ */ v(h, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
120
- }), E.length > 1 && /* @__PURE__ */ y("div", {
116
+ children: [/* @__PURE__ */ y(g, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
117
+ }), T.length > 1 && /* @__PURE__ */ b("div", {
121
118
  className: "flex items-center gap-2",
122
- children: [/* @__PURE__ */ v("label", {
119
+ children: [/* @__PURE__ */ y("label", {
123
120
  className: "text-sm text-text-secondary whitespace-nowrap",
124
- children: "Billing Account"
125
- }), /* @__PURE__ */ y("select", {
126
- value: A ?? "",
127
- onChange: (e) => O(e.target.value || null),
121
+ children: t("billing.invoices.billingAccountLabel", "Billing Account")
122
+ }), /* @__PURE__ */ b("select", {
123
+ value: k ?? "",
124
+ onChange: (e) => D(e.target.value || null),
128
125
  className: "text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
129
- children: [/* @__PURE__ */ v("option", {
126
+ children: [/* @__PURE__ */ y("option", {
130
127
  value: "",
131
- children: "All Accounts"
132
- }), E.map((e) => /* @__PURE__ */ y("option", {
128
+ children: t("billing.invoices.allAccounts", "All Accounts")
129
+ }), T.map((e) => /* @__PURE__ */ b("option", {
133
130
  value: e.id ?? "",
134
- children: [e.name ?? e.email ?? e.id, e.isDefault ? " (Default)" : ""]
131
+ children: [e.name ?? e.email ?? e.id, e.isDefault ? t("billing.invoices.defaultSuffix", " (Default)") : ""]
135
132
  }, e.id ?? ""))]
136
133
  })]
137
134
  })]
138
135
  })]
139
136
  }),
140
- /* @__PURE__ */ y("div", {
137
+ /* @__PURE__ */ b("div", {
141
138
  className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle",
142
- children: [/* @__PURE__ */ v("div", {
139
+ children: [/* @__PURE__ */ y("div", {
143
140
  className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap",
144
141
  children: [
145
142
  "all",
@@ -147,129 +144,127 @@ var C = () => {
147
144
  "PAID",
148
145
  "DRAFT",
149
146
  "VOID"
150
- ].map((e) => /* @__PURE__ */ v("button", {
147
+ ].map((e) => /* @__PURE__ */ y("button", {
151
148
  type: "button",
152
149
  onClick: () => {
153
- M(e), R(1);
150
+ j(e), L(1);
154
151
  },
155
- className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${j === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
156
- children: e === "all" ? "All" : i(e)
152
+ className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${A === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
153
+ children: e === "all" ? "All" : a(e)
157
154
  }, e))
158
- }), /* @__PURE__ */ y("div", {
155
+ }), /* @__PURE__ */ b("div", {
159
156
  className: "relative flex-1 min-w-0 w-full sm:max-w-md",
160
- children: [/* @__PURE__ */ v("svg", {
157
+ children: [/* @__PURE__ */ y("svg", {
161
158
  className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary",
162
159
  fill: "none",
163
160
  viewBox: "0 0 24 24",
164
161
  stroke: "currentColor",
165
- children: /* @__PURE__ */ v("path", {
162
+ children: /* @__PURE__ */ y("path", {
166
163
  strokeLinecap: "round",
167
164
  strokeLinejoin: "round",
168
165
  strokeWidth: 2,
169
166
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
170
167
  })
171
- }), /* @__PURE__ */ v("input", {
168
+ }), /* @__PURE__ */ y("input", {
172
169
  type: "text",
173
170
  placeholder: t("billing.invoices.searchPlaceholder", "Search by invoice number..."),
174
- value: N,
175
- onChange: (e) => P(e.target.value),
171
+ value: M,
172
+ onChange: (e) => N(e.target.value),
176
173
  className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
177
174
  })]
178
175
  })]
179
176
  }),
180
- !H && B.length === 0 ? /* @__PURE__ */ v(x, {
181
- illustration: j !== "all" || F ? "empty-search" : "empty-files",
177
+ !V && z.length === 0 ? /* @__PURE__ */ y(x, {
178
+ illustration: A !== "all" || P ? "empty-search" : "empty-files",
182
179
  title: t("billing.invoices.noInvoicesFound", "No invoices found"),
183
- description: j !== "all" || F ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
184
- }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
180
+ description: A !== "all" || P ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
181
+ }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
185
182
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
186
- children: /* @__PURE__ */ y("table", {
183
+ children: /* @__PURE__ */ b("table", {
187
184
  className: "w-full",
188
- children: [/* @__PURE__ */ v("thead", {
185
+ children: [/* @__PURE__ */ y("thead", {
189
186
  className: "bg-bg-sunken",
190
- children: /* @__PURE__ */ y("tr", { children: [
191
- /* @__PURE__ */ v("th", {
187
+ children: /* @__PURE__ */ b("tr", { children: [
188
+ /* @__PURE__ */ y("th", {
192
189
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
193
- children: "Invoice"
190
+ children: t("billing.invoices.invoice", "Invoice")
194
191
  }),
195
- /* @__PURE__ */ v("th", {
192
+ /* @__PURE__ */ y("th", {
196
193
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
197
- children: "Status"
194
+ children: t("billing.common.status", "Status")
198
195
  }),
199
- !A && E.length > 1 && /* @__PURE__ */ v("th", {
196
+ !k && T.length > 1 && /* @__PURE__ */ y("th", {
200
197
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell",
201
- children: "Account"
198
+ children: t("billing.common.account", "Account")
202
199
  }),
203
- /* @__PURE__ */ v("th", {
200
+ /* @__PURE__ */ y("th", {
204
201
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell",
205
- children: "Date"
202
+ children: t("billing.common.date", "Date")
206
203
  }),
207
- /* @__PURE__ */ v("th", {
204
+ /* @__PURE__ */ y("th", {
208
205
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell",
209
- children: "Due Date"
206
+ children: t("billing.common.dueDate", "Due Date")
210
207
  }),
211
- /* @__PURE__ */ v("th", {
208
+ /* @__PURE__ */ y("th", {
212
209
  className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
213
- children: "Amount"
210
+ children: t("billing.common.amount", "Amount")
214
211
  }),
215
- /* @__PURE__ */ v("th", {
212
+ /* @__PURE__ */ y("th", {
216
213
  className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
217
- children: "Actions"
214
+ children: t("billing.common.actions", "Actions")
218
215
  })
219
216
  ] })
220
- }), /* @__PURE__ */ v("tbody", {
217
+ }), /* @__PURE__ */ y("tbody", {
221
218
  className: "divide-y divide-border-subtle",
222
- children: B.map((e) => /* @__PURE__ */ v(w, {
219
+ children: z.map((e) => /* @__PURE__ */ y(w, {
223
220
  invoice: e,
224
- onView: () => n(l(`/invoices/${e.id}`, e.billingAccountId)),
221
+ onView: () => n(u(`/invoices/${e.id}`, e.billingAccountId)),
225
222
  canPay: r.canPayInvoice,
226
223
  canVoid: r.canVoidInvoice,
227
- showAccount: !A && E.length > 1,
228
- accountName: E.find((t) => t.id === e.billingAccountId)?.name ?? null
224
+ showAccount: !k && T.length > 1,
225
+ accountName: T.find((t) => t.id === e.billingAccountId)?.name ?? null
229
226
  }, e.id))
230
227
  })]
231
228
  })
232
- }), V > 1 && /* @__PURE__ */ y("div", {
229
+ }), B > 1 && /* @__PURE__ */ b("div", {
233
230
  className: "flex items-center justify-between pt-2",
234
231
  children: [/* @__PURE__ */ y("p", {
235
232
  className: "text-sm text-text-secondary",
236
- children: [
237
- "Page ",
238
- L,
239
- " of ",
240
- V
241
- ]
242
- }), /* @__PURE__ */ y("div", {
233
+ children: t("billing.common.pageOf", "Page {{page}} of {{totalPages}}", {
234
+ page: I,
235
+ totalPages: B
236
+ })
237
+ }), /* @__PURE__ */ b("div", {
243
238
  className: "flex items-center gap-2",
244
- children: [/* @__PURE__ */ v("button", {
239
+ children: [/* @__PURE__ */ y("button", {
245
240
  type: "button",
246
- onClick: () => R((e) => Math.max(1, e - 1)),
247
- disabled: L <= 1,
241
+ onClick: () => L((e) => Math.max(1, e - 1)),
242
+ disabled: I <= 1,
248
243
  className: "px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
249
- children: "Previous"
250
- }), /* @__PURE__ */ v("button", {
244
+ children: t("billing.common.previous", "Previous")
245
+ }), /* @__PURE__ */ y("button", {
251
246
  type: "button",
252
- onClick: () => R((e) => Math.min(V, e + 1)),
253
- disabled: L >= V,
247
+ onClick: () => L((e) => Math.min(B, e + 1)),
248
+ disabled: I >= B,
254
249
  className: "px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
255
- children: "Next"
250
+ children: t("billing.common.next", "Next")
256
251
  })]
257
252
  })]
258
253
  })] })
259
254
  ]
260
- }) : /* @__PURE__ */ v("div", {
255
+ }) : /* @__PURE__ */ y("div", {
261
256
  className: "flex items-center justify-center h-full min-h-[400px]",
262
- children: /* @__PURE__ */ y("div", {
257
+ children: /* @__PURE__ */ b("div", {
263
258
  className: "text-center space-y-2",
264
259
  children: [
265
- /* @__PURE__ */ v("div", {
260
+ /* @__PURE__ */ y("div", {
266
261
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
267
- children: /* @__PURE__ */ v("svg", {
262
+ children: /* @__PURE__ */ y("svg", {
268
263
  className: "size-6 text-text-secondary",
269
264
  fill: "none",
270
265
  viewBox: "0 0 24 24",
271
266
  stroke: "currentColor",
272
- children: /* @__PURE__ */ v("path", {
267
+ children: /* @__PURE__ */ y("path", {
273
268
  strokeLinecap: "round",
274
269
  strokeLinejoin: "round",
275
270
  strokeWidth: 2,
@@ -277,103 +272,103 @@ var C = () => {
277
272
  })
278
273
  })
279
274
  }),
280
- /* @__PURE__ */ v("h2", {
275
+ /* @__PURE__ */ y("h2", {
281
276
  className: "text-lg font-semibold text-text-primary",
282
277
  children: t("billing.accessDenied.title", "Access Denied")
283
278
  }),
284
- /* @__PURE__ */ v("p", {
279
+ /* @__PURE__ */ y("p", {
285
280
  className: "text-sm text-text-secondary max-w-sm",
286
281
  children: t("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
287
282
  })
288
283
  ]
289
284
  })
290
285
  });
291
- }, w = ({ invoice: o, onView: s, canPay: c, canVoid: l, showAccount: u = !1, accountName: d }) => {
292
- let f = a(o.status), p = o.status === "OPEN", m = o.status === "DRAFT";
293
- return /* @__PURE__ */ y("tr", {
286
+ }, w = ({ invoice: s, onView: c, canPay: l, canVoid: u, showAccount: d = !1, accountName: f }) => {
287
+ let p = e(), m = o(s.status), h = s.status === "OPEN", g = s.status === "DRAFT";
288
+ return /* @__PURE__ */ b("tr", {
294
289
  className: "hover:bg-bg-sunken transition-colors",
295
290
  children: [
296
- /* @__PURE__ */ y("td", {
291
+ /* @__PURE__ */ b("td", {
297
292
  className: "p-4",
298
- children: [o.invoiceUrl ? /* @__PURE__ */ v("a", {
299
- href: o.invoiceUrl,
293
+ children: [s.invoiceUrl ? /* @__PURE__ */ y("a", {
294
+ href: s.invoiceUrl,
300
295
  target: "_blank",
301
296
  rel: "noopener noreferrer",
302
297
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
303
- children: r(o.invoiceNumber)
304
- }) : /* @__PURE__ */ v("button", {
298
+ children: i(s.invoiceNumber)
299
+ }) : /* @__PURE__ */ y("button", {
305
300
  type: "button",
306
- onClick: s,
301
+ onClick: c,
307
302
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
308
- children: r(o.invoiceNumber)
309
- }), (o.itemDescription ?? o.subscription?.plan?.name) && /* @__PURE__ */ v("p", {
303
+ children: i(s.invoiceNumber)
304
+ }), (s.itemDescription ?? s.subscription?.plan?.name) && /* @__PURE__ */ y("p", {
310
305
  className: "text-sm text-text-secondary mt-0.5",
311
- children: o.itemDescription ?? o.subscription?.plan?.name
306
+ children: s.itemDescription ?? s.subscription?.plan?.name
312
307
  })]
313
308
  }),
314
- /* @__PURE__ */ v("td", {
309
+ /* @__PURE__ */ y("td", {
315
310
  className: "p-4",
316
- children: /* @__PURE__ */ v(e, {
317
- status: f,
311
+ children: /* @__PURE__ */ y(t, {
312
+ status: m,
318
313
  dot: !0,
319
- children: i(o.status)
314
+ children: a(s.status)
320
315
  })
321
316
  }),
322
- u && /* @__PURE__ */ v("td", {
317
+ d && /* @__PURE__ */ y("td", {
323
318
  className: "p-4 hidden lg:table-cell",
324
- children: d ? /* @__PURE__ */ v("span", {
319
+ children: f ? /* @__PURE__ */ y("span", {
325
320
  className: "inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-bg-sunken text-text-secondary border border-border-subtle",
326
- children: d
327
- }) : /* @__PURE__ */ v("span", {
321
+ children: f
322
+ }) : /* @__PURE__ */ y("span", {
328
323
  className: "text-sm text-text-secondary",
329
324
  children: ", "
330
325
  })
331
326
  }),
332
- /* @__PURE__ */ v("td", {
327
+ /* @__PURE__ */ y("td", {
333
328
  className: "p-4 text-sm text-text-secondary hidden sm:table-cell",
334
- children: n(o.createdAt, "short")
329
+ children: r(s.createdAt, "short")
335
330
  }),
336
- /* @__PURE__ */ v("td", {
331
+ /* @__PURE__ */ y("td", {
337
332
  className: "p-4 text-sm text-text-secondary hidden md:table-cell",
338
- children: o.dueDate ? n(o.dueDate, "short") : "—"
333
+ children: s.dueDate ? r(s.dueDate, "short") : "—"
339
334
  }),
340
- /* @__PURE__ */ v("td", {
335
+ /* @__PURE__ */ y("td", {
341
336
  className: "p-4 text-right font-medium text-text-primary",
342
- children: t(o.total, o.currency)
337
+ children: n(s.total, s.currency)
343
338
  }),
344
- /* @__PURE__ */ v("td", {
339
+ /* @__PURE__ */ y("td", {
345
340
  className: "p-4 text-right",
346
- children: /* @__PURE__ */ y("div", {
341
+ children: /* @__PURE__ */ b("div", {
347
342
  className: "flex items-center justify-end gap-2",
348
343
  children: [
349
- o.invoiceUrl ? /* @__PURE__ */ v("a", {
350
- href: o.invoiceUrl,
344
+ s.invoiceUrl ? /* @__PURE__ */ y("a", {
345
+ href: s.invoiceUrl,
351
346
  target: "_blank",
352
347
  rel: "noopener noreferrer",
353
348
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
354
- children: "View"
355
- }) : /* @__PURE__ */ v("button", {
349
+ children: p("billing.common.view", "View")
350
+ }) : /* @__PURE__ */ y("button", {
356
351
  type: "button",
357
- onClick: s,
352
+ onClick: c,
358
353
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
359
- children: "View"
354
+ children: p("billing.common.view", "View")
360
355
  }),
361
- o.pdfUrl && /* @__PURE__ */ v("a", {
362
- href: o.pdfUrl,
356
+ s.pdfUrl && /* @__PURE__ */ y("a", {
357
+ href: s.pdfUrl,
363
358
  target: "_blank",
364
359
  rel: "noopener noreferrer",
365
360
  className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
366
- children: "PDF"
361
+ children: p("billing.common.pdf", "PDF")
367
362
  }),
368
- p && c && /* @__PURE__ */ v("button", {
363
+ h && l && /* @__PURE__ */ y("button", {
369
364
  type: "button",
370
365
  className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
371
- children: "Pay"
366
+ children: p("billing.common.pay", "Pay")
372
367
  }),
373
- (p || m) && l && /* @__PURE__ */ v("button", {
368
+ (h || g) && u && /* @__PURE__ */ y("button", {
374
369
  type: "button",
375
370
  className: "px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-button transition-colors duration-200",
376
- children: "Void"
371
+ children: p("billing.common.void", "Void")
377
372
  })
378
373
  ]
379
374
  })