@usethrottle/auth 0.4.0 → 0.5.0
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.
|
@@ -4385,6 +4385,14 @@ var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
|
4385
4385
|
var CAN_PAUSE = /* @__PURE__ */ new Set(["active", "trialing"]);
|
|
4386
4386
|
var CAN_RESUME = /* @__PURE__ */ new Set(["paused"]);
|
|
4387
4387
|
var CAN_CANCEL2 = /* @__PURE__ */ new Set(["active", "trialing", "paused", "past_due", "unpaid"]);
|
|
4388
|
+
var INTERVAL_WORD = {
|
|
4389
|
+
weekly: "week",
|
|
4390
|
+
biweekly: "2 weeks",
|
|
4391
|
+
monthly: "month",
|
|
4392
|
+
quarterly: "quarter",
|
|
4393
|
+
yearly: "year"
|
|
4394
|
+
};
|
|
4395
|
+
var intervalWord = (interval) => INTERVAL_WORD[interval] ?? interval;
|
|
4388
4396
|
function SubscriptionsPanel(props) {
|
|
4389
4397
|
const a = useAppearance(props.appearance);
|
|
4390
4398
|
const scoped = useAppearanceProviderValue(props.appearance);
|
|
@@ -4404,7 +4412,7 @@ function SubscriptionsPanel(props) {
|
|
|
4404
4412
|
await run(fn);
|
|
4405
4413
|
})();
|
|
4406
4414
|
};
|
|
4407
|
-
const priceLabel = (sub) => `${formatMoney(sub.amount, sub.currency, locale)} / ${sub.interval}${sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""}`;
|
|
4415
|
+
const priceLabel = (sub) => `${formatMoney(sub.amount, sub.currency, locale)} / ${intervalWord(sub.interval)}${sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""}`;
|
|
4408
4416
|
const renewsLabel = (sub) => formatDate(sub.status === "cancelled" ? sub.cancelledAt ?? sub.currentPeriodEnd : sub.currentPeriodEnd, locale);
|
|
4409
4417
|
const lifecycleActions = (sub, variantFor) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "throttle-actions", children: [
|
|
4410
4418
|
CAN_PAUSE.has(sub.status) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -4500,7 +4508,7 @@ function SubscriptionsPanel(props) {
|
|
|
4500
4508
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: "throttle-muted", children: [
|
|
4501
4509
|
formatMoney(sub.amount, sub.currency, locale),
|
|
4502
4510
|
" / ",
|
|
4503
|
-
sub.interval,
|
|
4511
|
+
intervalWord(sub.interval),
|
|
4504
4512
|
sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""
|
|
4505
4513
|
] }),
|
|
4506
4514
|
sub.status === "cancelled" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: "throttle-muted", children: [
|