@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.
@@ -3708,6 +3708,14 @@ import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
3708
3708
  var CAN_PAUSE = /* @__PURE__ */ new Set(["active", "trialing"]);
3709
3709
  var CAN_RESUME = /* @__PURE__ */ new Set(["paused"]);
3710
3710
  var CAN_CANCEL2 = /* @__PURE__ */ new Set(["active", "trialing", "paused", "past_due", "unpaid"]);
3711
+ var INTERVAL_WORD = {
3712
+ weekly: "week",
3713
+ biweekly: "2 weeks",
3714
+ monthly: "month",
3715
+ quarterly: "quarter",
3716
+ yearly: "year"
3717
+ };
3718
+ var intervalWord = (interval) => INTERVAL_WORD[interval] ?? interval;
3711
3719
  function SubscriptionsPanel(props) {
3712
3720
  const a = useAppearance(props.appearance);
3713
3721
  const scoped = useAppearanceProviderValue(props.appearance);
@@ -3727,7 +3735,7 @@ function SubscriptionsPanel(props) {
3727
3735
  await run(fn);
3728
3736
  })();
3729
3737
  };
3730
- const priceLabel = (sub) => `${formatMoney(sub.amount, sub.currency, locale)} / ${sub.interval}${sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""}`;
3738
+ const priceLabel = (sub) => `${formatMoney(sub.amount, sub.currency, locale)} / ${intervalWord(sub.interval)}${sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""}`;
3731
3739
  const renewsLabel = (sub) => formatDate(sub.status === "cancelled" ? sub.cancelledAt ?? sub.currentPeriodEnd : sub.currentPeriodEnd, locale);
3732
3740
  const lifecycleActions = (sub, variantFor) => /* @__PURE__ */ jsxs32("div", { className: "throttle-actions", children: [
3733
3741
  CAN_PAUSE.has(sub.status) ? /* @__PURE__ */ jsx42(
@@ -3823,7 +3831,7 @@ function SubscriptionsPanel(props) {
3823
3831
  /* @__PURE__ */ jsxs32("p", { className: "throttle-muted", children: [
3824
3832
  formatMoney(sub.amount, sub.currency, locale),
3825
3833
  " / ",
3826
- sub.interval,
3834
+ intervalWord(sub.interval),
3827
3835
  sub.quantity > 1 ? ` \xD7 ${sub.quantity}` : ""
3828
3836
  ] }),
3829
3837
  sub.status === "cancelled" ? /* @__PURE__ */ jsxs32("p", { className: "throttle-muted", children: [