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