decord/source/modules/polls/native/useRenderPollAnswerImage.tsx

96 lines
3.3 KiB
TypeScript
Raw Normal View History

// Module ID: 12230
// Function ID: 12231
2026-07-20 16:05:17 +00:00
// Name: useRenderPollAnswerImage
// Dependencies: [32, 19, 17, 4901, 4900, 1374, 21, 504, 12210, 5587, 7130, 4216, 1396, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12230 (useRenderPollAnswerImage)
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { ActivityIndicator } from "get ActivityIndicator" /* 17 */;
import { DraftType } from "handleChanged" /* 4901 */;
import closure_7 from "map" /* 4900 */;
import { EMOJI_URL_BASE_SIZE } from "set" /* 1374 */;
2026-08-24 06:08:38 +00:00
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/polls/native/useRenderPollAnswerImage.tsx");
2026-07-20 16:05:17 +00:00
export default function useRenderPollAnswerImage(arg0, arg1, mediaAttachmentState) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
dependencyMap = mediaAttachmentState;
2026-07-20 16:05:17 +00:00
const callback = arg3;
const React = arg4;
let obj = _require(504);
2026-08-24 06:08:38 +00:00
const items = [closure_7];
const stateFromStores = obj.useStateFromStores(items, () => upload.getUpload(closure_0, closure_1, first.Poll));
2026-07-29 08:29:29 +00:00
const tmp4 = callback(React.useState(), 2);
const first = tmp4[0];
2026-07-20 16:05:17 +00:00
let status;
2026-07-29 08:29:29 +00:00
if (mediaAttachmentState != null) {
2026-07-20 16:05:17 +00:00
mediaAttachmentState = mediaAttachmentState.mediaAttachmentState;
2026-07-29 08:29:29 +00:00
if (mediaAttachmentState != null) {
2026-07-20 16:05:17 +00:00
status = mediaAttachmentState.status;
}
}
const tmp7 = status === _require(12210).PollMediaUploadAttachmentStatus.PREPARING;
2026-08-24 06:08:38 +00:00
closure_7 = tmp7;
2026-07-20 16:05:17 +00:00
obj = {
renderImage: React.useMemo(() => {
2026-08-24 06:08:38 +00:00
if (closure_7) {
return closure_1_9(stateFromStores, {});
2026-07-20 16:05:17 +00:00
} else if (null != stateFromStores) {
2026-08-24 06:08:38 +00:00
let tmp14 = closure_3;
if (closure_3 == null) {
2026-07-29 08:29:29 +00:00
tmp14 = first;
}
let obj = { style: null, source: null };
obj = { width: null, height: null };
obj[0] = tmp14;
obj[1] = tmp14;
obj[0] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { uri: null };
2026-07-29 08:29:29 +00:00
obj1[0] = stateFromStores.item.uri;
obj[1] = obj1;
2026-08-24 06:08:38 +00:00
return closure_1_9(callback2(mediaAttachmentState[9]), obj);
2026-07-20 16:05:17 +00:00
} else {
let emoji;
2026-07-29 08:29:29 +00:00
if (mediaAttachmentState != null) {
emoji = tmp20.emoji;
2026-07-20 16:05:17 +00:00
}
if (null != emoji) {
2026-07-29 08:29:29 +00:00
emoji = tmp20.emoji;
obj = { fastImageStyle: null, textEmojiStyle: null, name: null, src: null };
const obj2 = { width: null, height: null };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_4;
obj2[1] = closure_4;
2026-07-29 08:29:29 +00:00
obj[0] = obj2;
let obj3 = { fontSize: null };
2026-08-24 06:08:38 +00:00
obj3[0] = closure_4;
2026-07-29 08:29:29 +00:00
obj[1] = obj3;
let str = emoji.type === callback(mediaAttachmentState[11]).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = str;
2026-07-20 16:05:17 +00:00
let emojiURL;
if (null != emoji.id) {
2026-07-23 10:11:24 +00:00
obj3 = callback2(mediaAttachmentState[12]);
2026-07-29 08:29:29 +00:00
const obj4 = { id: null, animated: null, size: null };
({ id: obj5[0], animated: obj5[1] } = emoji);
2026-08-24 06:08:38 +00:00
obj4[2] = closure_1_8;
2026-07-20 16:05:17 +00:00
emojiURL = obj3.getEmojiURL(obj4);
}
2026-07-29 08:29:29 +00:00
obj[3] = emojiURL;
2026-08-24 06:08:38 +00:00
return closure_1_9(callback2(mediaAttachmentState[10]), obj);
2026-07-20 16:05:17 +00:00
}
}
}, items1),
upload: stateFromStores,
2026-07-29 08:29:29 +00:00
setUploadSize: tmp4[1]
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
items1 = [mediaAttachmentState, arg4, arg3, stateFromStores, tmp7, first];
2026-07-20 16:05:17 +00:00
return obj;
};