decord/source/modules/chat/native/SlowModeIndicator.tsx

56 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 12113
// Function ID: 12114
// Name: SlowModeIndicator
// Dependencies: [19, 7789, 21, 4636, 576, 504, 7790, 4335, 11735, 5204, 4632, 2]
2026-07-20 16:05:17 +00:00
// Module 12113 (SlowModeIndicator)
import nativeDefault from "native" /* 576 */;
import ToastActionCreatorsDefault from "ToastActionCreators" /* 4335 */;
import SlowmodeUtils from "SlowmodeUtils" /* 7790 */;
import TimerIcon from "TimerIcon" /* 11735 */;
import noop from "module_19" /* 19 */;
import SlowmodeStore from "SlowmodeStore" /* 7789 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
const createStyles = fn(4636);
let obj = { container: { alignItems: "center", flexDirection: "row" }, icon: { marginLeft: nativeDefault.space.PX_4 } };
let closure_7 = createStyles.createStyles(obj);
let obj3 = { marginLeft: nativeDefault.space.PX_4 };
const size = fn(2);
const result = size.fileFinishedImporting("modules/chat/native/SlowModeIndicator.tsx");
export default noop.memo(function SlowModeIndicator(channel) {
2026-07-20 16:05:17 +00:00
channel = channel.channel;
const hasTypingText = channel.hasTypingText;
const slowmodeType = channel.slowmodeType;
2026-07-29 08:29:29 +00:00
let canBypassSlowmode;
const tmp = closure_7();
2026-07-23 10:11:24 +00:00
const items = [canBypassSlowmode];
const stateFromStores = channel(slowmodeType[5]).useStateFromStores(items, () => SlowmodeStore.getSlowmodeCooldownGuess(channel.id, slowmodeType));
let obj = channel(slowmodeType[5]);
2026-07-29 08:29:29 +00:00
canBypassSlowmode = channel(slowmodeType[6]).useCanBypassSlowmode(channel);
2026-07-20 16:05:17 +00:00
const items1 = [hasTypingText, canBypassSlowmode, stateFromStores];
const items2 = [channel.rateLimitPerUser];
2026-07-23 10:11:24 +00:00
const memo = stateFromStores.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (hasTypingText) {
if (!canBypassSlowmode) {
let slowmodeIndicatorText = null;
}
return slowmodeIndicatorText;
}
slowmodeIndicatorText = SlowmodeUtils.getSlowmodeIndicatorText(stateFromStores, canBypassSlowmode);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-23 10:11:24 +00:00
const callback = stateFromStores.useCallback(() => {
const obj2 = { key: "CHANNEL_SLOWMODE_INFO", IconComponent: TimerIcon.TimerIcon, content: null };
const obj = ToastActionCreatorsDefault;
obj2.content = SlowmodeUtils.getSlowmodeDescription(channel.rateLimitPerUser);
obj.open(obj2);
2026-07-20 16:05:17 +00:00
}, items2);
const obj3 = { onPress: callback, style: tmp.container, children: null };
const items3 = [closure_5(channel(slowmodeType[10]).Text, { lineClamp: 1, allowFontScaling: false, variant: "text-xs/medium", color: "interactive-text-default", children: memo }), closure_5(channel(slowmodeType[8]).TimerIcon, { style: tmp.icon, size: "xxs" })];
obj3.children = items3;
return closure_6(channel(slowmodeType[9]).PressableOpacity, obj3);
2026-07-20 16:05:17 +00:00
});