@voyantjs/bookings-ui 0.26.7 → 0.26.8
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.
|
@@ -60,7 +60,7 @@ export function BookingPaymentsSummary({ bookingId, variant = "public", }) {
|
|
|
60
60
|
const totalCompleted = payments
|
|
61
61
|
.filter((p) => p.status === "completed")
|
|
62
62
|
.reduce((sum, p) => sum + p.amountCents, 0);
|
|
63
|
-
const currency = payments[0]?.currency ??
|
|
63
|
+
const currency = payments[0]?.currency ?? null;
|
|
64
64
|
return (_jsxs(Card, { "data-slot": "booking-payments-summary", children: [_jsx(CardHeader, { className: "pb-3", children: _jsxs(CardTitle, { className: "flex flex-wrap items-center gap-2 text-base", children: [_jsx(CreditCard, { className: "h-4 w-4 text-muted-foreground" }), messages.bookingPaymentsSummary.title, payments.length > 0 ? (_jsx(Badge, { variant: "outline", className: "text-[10px]", children: payments.length })) : null, totalCompleted > 0 ? (_jsxs("span", { className: "ml-auto text-muted-foreground text-xs", children: ["Total received", " ", _jsx("span", { className: "font-medium text-foreground", children: formatMoney(totalCompleted, currency) })] })) : null] }) }), _jsx(CardContent, { className: "overflow-hidden p-0", children: payments.length === 0 ? (_jsx("p", { className: "py-6 text-center text-muted-foreground text-sm", children: messages.bookingPaymentsSummary.empty })) : (_jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b text-muted-foreground", children: [_jsx("th", { className: "px-4 py-2 text-right font-medium", children: messages.bookingPaymentsSummary.columns.amount }), _jsx("th", { className: "px-4 py-2 text-left font-medium", children: messages.bookingPaymentsSummary.columns.method }), _jsx("th", { className: "px-4 py-2 text-left font-medium", children: messages.bookingPaymentsSummary.columns.status }), _jsx("th", { className: "px-4 py-2 text-left font-medium", children: messages.bookingPaymentsSummary.columns.date }), _jsx("th", { className: "px-4 py-2 text-left font-medium", children: messages.bookingPaymentsSummary.columns.reference }), _jsx("th", { className: "px-4 py-2 text-left font-medium", children: messages.bookingPaymentsSummary.columns.invoice })] }) }), _jsx("tbody", { children: payments.map((payment) => {
|
|
65
65
|
const MethodIcon = methodIcon[payment.paymentMethod] ?? Receipt;
|
|
66
66
|
const methodLabel = messages.bookingPaymentsSummary.paymentMethodLabels[payment.paymentMethod] ?? payment.paymentMethod;
|
|
@@ -68,6 +68,12 @@ export function BookingPaymentsSummary({ bookingId, variant = "public", }) {
|
|
|
68
68
|
}) })] }) })) })] }));
|
|
69
69
|
}
|
|
70
70
|
function formatMoney(cents, currency) {
|
|
71
|
+
if (!currency) {
|
|
72
|
+
return new Intl.NumberFormat(undefined, {
|
|
73
|
+
minimumFractionDigits: 2,
|
|
74
|
+
maximumFractionDigits: 2,
|
|
75
|
+
}).format(cents / 100);
|
|
76
|
+
}
|
|
71
77
|
try {
|
|
72
78
|
return new Intl.NumberFormat(undefined, { style: "currency", currency }).format(cents / 100);
|
|
73
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-ui",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"react-dom": "^19.0.0",
|
|
52
52
|
"react-hook-form": "^7.60.0",
|
|
53
53
|
"zod": "^4.3.6",
|
|
54
|
-
"@voyantjs/availability-react": "0.26.
|
|
55
|
-
"@voyantjs/bookings-react": "0.26.
|
|
56
|
-
"@voyantjs/catalog": "0.26.
|
|
57
|
-
"@voyantjs/catalog-react": "0.26.
|
|
58
|
-
"@voyantjs/crm-react": "0.26.
|
|
59
|
-
"@voyantjs/finance-react": "0.26.
|
|
60
|
-
"@voyantjs/legal-react": "0.26.
|
|
61
|
-
"@voyantjs/products-react": "0.26.
|
|
62
|
-
"@voyantjs/ui": "0.26.
|
|
54
|
+
"@voyantjs/availability-react": "0.26.8",
|
|
55
|
+
"@voyantjs/bookings-react": "0.26.8",
|
|
56
|
+
"@voyantjs/catalog": "0.26.8",
|
|
57
|
+
"@voyantjs/catalog-react": "0.26.8",
|
|
58
|
+
"@voyantjs/crm-react": "0.26.8",
|
|
59
|
+
"@voyantjs/finance-react": "0.26.8",
|
|
60
|
+
"@voyantjs/legal-react": "0.26.8",
|
|
61
|
+
"@voyantjs/products-react": "0.26.8",
|
|
62
|
+
"@voyantjs/ui": "0.26.8"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@voyantjs/i18n": "0.26.
|
|
65
|
+
"@voyantjs/i18n": "0.26.8"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -75,16 +75,16 @@
|
|
|
75
75
|
"typescript": "^6.0.2",
|
|
76
76
|
"vitest": "^4.1.2",
|
|
77
77
|
"zod": "^4.3.6",
|
|
78
|
-
"@voyantjs/availability-react": "0.26.
|
|
79
|
-
"@voyantjs/bookings-react": "0.26.
|
|
80
|
-
"@voyantjs/catalog": "0.26.
|
|
81
|
-
"@voyantjs/catalog-react": "0.26.
|
|
82
|
-
"@voyantjs/crm-react": "0.26.
|
|
83
|
-
"@voyantjs/finance-react": "0.26.
|
|
84
|
-
"@voyantjs/legal-react": "0.26.
|
|
85
|
-
"@voyantjs/products-react": "0.26.
|
|
78
|
+
"@voyantjs/availability-react": "0.26.8",
|
|
79
|
+
"@voyantjs/bookings-react": "0.26.8",
|
|
80
|
+
"@voyantjs/catalog": "0.26.8",
|
|
81
|
+
"@voyantjs/catalog-react": "0.26.8",
|
|
82
|
+
"@voyantjs/crm-react": "0.26.8",
|
|
83
|
+
"@voyantjs/finance-react": "0.26.8",
|
|
84
|
+
"@voyantjs/legal-react": "0.26.8",
|
|
85
|
+
"@voyantjs/products-react": "0.26.8",
|
|
86
86
|
"@voyantjs/voyant-typescript-config": "0.1.0",
|
|
87
|
-
"@voyantjs/ui": "0.26.
|
|
87
|
+
"@voyantjs/ui": "0.26.8"
|
|
88
88
|
},
|
|
89
89
|
"files": [
|
|
90
90
|
"dist",
|