decord/beta/source/modules/messages/CtaButtonUtils.tsx

59 lines
2.5 KiB
TypeScript
Raw Normal View History

// Module ID: 11390
// Function ID: 11391
// Name: CtaButtonUtils
// Dependencies: [5049, 11391, 5048, 504, 2]
// Exports: getCtaButtonType, useCtaButtonType
// Module 11390 (CtaButtonUtils)
2026-10-01 14:13:23 +00:00
import get_initialized from "get initialized" /* 504 */;
import AgeVerificationUtils from "AgeVerificationUtils" /* 5048 */;
import useShouldRenderReportFalsePositiveButton from "useShouldRenderReportFalsePositiveButton" /* 11391 */;
import FamilyCenterPendingConnectionStore from "FamilyCenterPendingConnectionStore" /* 5049 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const CtaButtonType = { MARK_AS_FALSE_POSITIVE: "mark_as_false_positive", AGE_VERIFICATION_RETRY: "age_verification_retry", CONNECT_TO_TEEN: "connect_to_teen", AGE_VERIFICATION_MANUAL_REVIEW: "age_verification_manual_review" };
let result = size.fileFinishedImporting("modules/messages/CtaButtonUtils.tsx");
export { CtaButtonType };
export const getCtaButtonType = function getCtaButtonType(id, channel_id) {
2026-10-01 14:13:23 +00:00
let CONNECT_TO_TEEN;
const obj = useShouldRenderReportFalsePositiveButton;
if (obj.shouldRenderReportFalsePositiveButton(id)) {
2026-10-01 14:13:23 +00:00
CONNECT_TO_TEEN = obj.MARK_AS_FALSE_POSITIVE;
} else {
2026-10-01 14:13:23 +00:00
const tmpResult = AgeVerificationUtils;
if (tmpResult.isAgeVerificationMessageWithRetryCta(channel_id, id)) {
CONNECT_TO_TEEN = obj.AGE_VERIFICATION_RETRY;
} else {
2026-10-01 14:13:23 +00:00
const tmpResult2 = AgeVerificationUtils;
if (tmpResult2.isAgeVerificationMessageWithConnectToTeenCta(channel_id, id)) {
CONNECT_TO_TEEN = obj.CONNECT_TO_TEEN;
}
}
}
return CONNECT_TO_TEEN;
};
export const useCtaButtonType = function useCtaButtonType(id, channel_id) {
2026-10-01 14:13:23 +00:00
let CONNECT_TO_TEEN;
let pendingConnection;
const obj = useShouldRenderReportFalsePositiveButton;
const shouldRenderReportFalsePositiveButton = obj.useShouldRenderReportFalsePositiveButton(id);
2026-10-01 14:13:23 +00:00
const obj2 = AgeVerificationUtils;
const result = obj2.isAgeVerificationMessageWithRetryCta(channel_id, id);
const items = [FamilyCenterPendingConnectionStore];
2026-10-01 14:13:23 +00:00
const obj3 = get_initialized;
let result1 = null != obj3.useStateFromStores(items, () => pendingConnection.getPendingConnection());
if (result1) {
const tmpResult = AgeVerificationUtils;
2026-10-01 14:13:23 +00:00
result1 = tmpResult.isAgeVerificationMessageWithConnectToTeenCta(channel_id, id);
}
if (shouldRenderReportFalsePositiveButton) {
2026-10-01 14:13:23 +00:00
CONNECT_TO_TEEN = obj.MARK_AS_FALSE_POSITIVE;
} else if (result) {
CONNECT_TO_TEEN = obj.AGE_VERIFICATION_RETRY;
} else if (result1) {
CONNECT_TO_TEEN = obj.CONNECT_TO_TEEN;
}
return CONNECT_TO_TEEN;
};