decord/source/modules/premium/native/hooks/useCheckoutPlanPriceString.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 6194
2026-07-27 11:26:19 +00:00
// Function ID: 55555
2026-07-20 16:05:17 +00:00
// Name: useCheckoutPlanPriceString
2026-07-25 08:10:48 +00:00
// Dependencies: [31, 6164, 6195, 477, 2]
2026-07-20 16:05:17 +00:00
// Exports: useCheckoutPlanPriceString
2026-07-25 08:10:48 +00:00
// Module 6194 (useCheckoutPlanPriceString)
2026-07-23 10:11:24 +00:00
import result from "result";
import { useNativeCheckoutStore } from "context";
const require = arg1;
const result = require("_createForOfIteratorHelperLoose").fileFinishedImporting("modules/premium/native/hooks/useCheckoutPlanPriceString.tsx");
2026-07-20 16:05:17 +00:00
2026-07-21 22:01:30 +00:00
export const useCheckoutPlanPriceString = function useCheckoutPlanPriceString(productId, first) {
2026-07-23 10:11:24 +00:00
const _require = productId;
2026-07-20 16:05:17 +00:00
let priceString;
2026-07-21 22:01:30 +00:00
if (null != first) {
priceString = first.priceString;
2026-07-20 16:05:17 +00:00
}
let tmp2 = null;
if (null != priceString) {
tmp2 = priceString;
}
const tmp4 = useNativeCheckoutStore((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
const dependencyMap = tmp4;
const items = [tmp4, productId];
const memo = React.useMemo(() => {
if (null == tmp4) {
return null;
} else {
2026-07-23 10:11:24 +00:00
const availablePlanForItems = tmp4.getAvailablePlanForItems(productId(tmp4[2]).getSubscriptionItemsForProduct(productId));
2026-07-20 16:05:17 +00:00
let priceString = null;
if (null != availablePlanForItems) {
priceString = availablePlanForItems.getPriceString();
}
return priceString;
}
}, items);
const tmp3 = useNativeCheckoutStore((orderRequired) => orderRequired.orderRequired);
let tmp6 = tmp2;
if (obj.isIOS()) {
tmp6 = tmp2;
if (false !== tmp3) {
tmp6 = memo;
}
}
return tmp6;
};