Files
discord-decomp/modules/premium/premium_group/PremiumGroupUtils.shared.tsx
T
2026-11-01 12:12:55 +02:00

25 lines
837 B
TypeScript

// Metro module 7832 (f7833).
import SubscriptionPlanStore from "../../../stores/billing/SubscriptionPlanStore";
import { getPrice } from "../../../utils/PremiumUtils";
import { formatPrice, formatRate } from "../../../utils/PriceUtils";
export function getPriceString(a0, a1) {
const withIntervals = (a1 == null ? {} : a1).withIntervals;
if (a0 != null && a0.hasAnyPremiumGroup) {
const planIdFromItems = a0.planIdFromItems;
if (planIdFromItems == null) {
return null;
}
const r13 = SubscriptionPlanStore.get(planIdFromItems);
if (r13 == null) {
return null;
}
const price = getPrice(planIdFromItems);
const r22 = formatPrice(price.amount, price.currency);
if (withIntervals) {
return formatRate(r22, r13.interval, r13.intervalCount);
}
return r22;
}
return null;
}