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

96 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-08-13 17:34:28 +00:00
// Module ID: 11654
// Function ID: 11655
2026-07-20 16:05:17 +00:00
// Name: useRenderPollAnswerImage
2026-08-13 17:34:28 +00:00
// Dependencies: [32, 19, 17, 4681, 4680, 1925, 21, 589, 11648, 5308, 5400, 4005, 1435, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-13 17:34:28 +00:00
// Module 11654 (useRenderPollAnswerImage)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import { ActivityIndicator } from "get ActivityIndicator";
2026-07-29 08:29:29 +00:00
import { DraftType } from "handleChanged";
import map from "map";
2026-07-23 10:11:24 +00:00
import { EMOJI_URL_BASE_SIZE } from "set";
import { jsx } from "jsxProd";
const require = arg1;
const result = require("get ActivityIndicator").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;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const dependencyMap = mediaAttachmentState;
const callback = arg3;
const React = arg4;
2026-07-29 08:29:29 +00:00
let obj = _require(589);
const items = [map];
const stateFromStores = obj.useStateFromStores(items, () => tmp7.getUpload(closure_0, closure_1, first.Poll));
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;
}
}
2026-08-13 17:34:28 +00:00
const tmp7 = status === _require(11648).PollMediaUploadAttachmentStatus.PREPARING;
2026-07-29 08:29:29 +00:00
map = tmp7;
2026-07-20 16:05:17 +00:00
obj = {
renderImage: React.useMemo(() => {
2026-07-29 08:29:29 +00:00
if (map) {
2026-07-23 10:11:24 +00:00
return outer1_9(stateFromStores, {});
2026-07-20 16:05:17 +00:00
} else if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
let tmp14 = _slicedToArray;
if (_slicedToArray == null) {
tmp14 = first;
}
let obj = { style: null, source: null };
obj = { width: null, height: null };
obj[0] = tmp14;
obj[1] = tmp14;
obj[0] = obj;
const obj1 = { uri: null };
obj1[0] = stateFromStores.item.uri;
obj[1] = obj1;
2026-07-23 10:11:24 +00:00
return outer1_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 };
obj2[0] = noop;
obj2[1] = noop;
obj[0] = obj2;
let obj3 = { fontSize: null };
obj3[0] = noop;
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);
obj4[2] = outer1_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-07-23 10:11:24 +00:00
return outer1_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;
};