decord/source/modules/share/native/ShareEmbed.tsx

170 lines
5.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13422
// Function ID: 13423
2026-07-20 16:05:17 +00:00
// Name: ShareEmbed
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 21, 4668, 712, 5451, 4739, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 13422 (ShareEmbed)
import ThemesDefault from "Themes" /* 712 */;
import closure_2 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Image: c3, View: c4 } = get_ActivityIndicator);
({ jsx: c5, jsxs: closure_6, Fragment: error } = jsxProd);
createCacheKey = { container: null, containerRevamp: null, thumbnail: null, contentContainer: null, authorView: null, authorThumbnail: null, loadingSpinner: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { flexDirection: "row", height: 80, backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW, borderColor: ThemesDefault.colors.BORDER_STRONG, borderWidth: 1, borderRadius: ThemesDefault.radii.sm, overflow: "hidden" };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { borderWidth: 0 };
createCacheKey[2] = { width: 80 };
createCacheKey[3] = { flex: 1, flexDirection: "column", justifyContent: "center", paddingLeft: 12, paddingRight: 24 };
createCacheKey[4] = { flexDirection: "row", alignItems: "center", marginBottom: 3 };
2026-08-24 06:08:38 +00:00
createCacheKey[5] = { height: 16, width: 16, borderRadius: ThemesDefault.radii.sm, marginRight: 4 };
2026-07-29 08:29:29 +00:00
createCacheKey[6] = { flex: 1 };
2026-08-24 06:08:38 +00:00
let closure_8 = createCacheKey.createStyles(createCacheKey);
let obj1 = { height: 16, width: 16, borderRadius: ThemesDefault.radii.sm, marginRight: 4 };
const result = require("set").fileFinishedImporting("modules/share/native/ShareEmbed.tsx");
2026-07-20 16:05:17 +00:00
export default function ShareEmbed(embed) {
embed = embed.embed;
const isLoadingEmbed = embed.isLoadingEmbed;
2026-07-29 08:29:29 +00:00
let React;
let memo3;
2026-08-24 06:08:38 +00:00
let tmp = callback();
2026-07-29 08:29:29 +00:00
React = tmp;
2026-07-23 10:11:24 +00:00
let items = [embed];
2026-07-20 16:05:17 +00:00
const memo = React.useMemo(() => {
if (null != embed) {
2026-07-29 08:29:29 +00:00
const thumbnail = tmp.thumbnail;
2026-07-20 16:05:17 +00:00
let url;
2026-07-29 08:29:29 +00:00
if (thumbnail != null) {
2026-07-20 16:05:17 +00:00
url = thumbnail.url;
}
2026-07-29 08:29:29 +00:00
if (url == null) {
const image = tmp.image;
2026-07-20 16:05:17 +00:00
let url1;
2026-07-29 08:29:29 +00:00
if (image != null) {
2026-07-20 16:05:17 +00:00
url1 = image.url;
}
url = url1;
}
if (null != url) {
2026-07-29 08:29:29 +00:00
const obj = { uri: null };
obj[0] = url;
2026-07-20 16:05:17 +00:00
return obj;
}
}
}, items);
const items1 = [isLoadingEmbed, tmp];
let memo1 = React.useMemo(() => {
let tmp = null;
if (isLoadingEmbed) {
2026-07-29 08:29:29 +00:00
const obj = { style: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_2.loadingSpinner;
tmp = closure_1_5(embed(isLoadingEmbed[5]).ActivityIndicator, obj);
2026-07-20 16:05:17 +00:00
}
return tmp;
}, items1);
const items2 = [embed, tmp];
const items3 = [embed];
const memo2 = React.useMemo(() => {
let author;
2026-07-29 08:29:29 +00:00
if (embed != null) {
2026-07-20 16:05:17 +00:00
author = embed.author;
}
if (null == author) {
return null;
} else {
let icon_url = author.proxy_icon_url;
2026-07-29 08:29:29 +00:00
if (icon_url == null) {
2026-07-20 16:05:17 +00:00
icon_url = author.icon_url;
}
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_2.authorView;
2026-07-29 08:29:29 +00:00
let tmp5 = null != icon_url;
if (tmp5) {
obj = { style: null, source: null, resizeMode: "cover" };
obj[0] = tmp4.authorThumbnail;
obj = { uri: null };
obj[0] = icon_url;
obj[1] = obj;
2026-08-24 06:08:38 +00:00
tmp5 = closure_1_5(memo3, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items = [tmp5, ];
2026-08-24 06:08:38 +00:00
obj1 = { variant: "text-xs/semibold", color: "mobile-text-heading-primary", ellipsizeMode: "tail", lineClamp: 1, children: null };
2026-07-29 08:29:29 +00:00
obj1[4] = author.name;
2026-08-24 06:08:38 +00:00
items[1] = closure_1_5(embed(isLoadingEmbed[6]).Text, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-08-24 06:08:38 +00:00
return closure_1_6(closure_1_4, obj);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-07-29 08:29:29 +00:00
memo3 = React.useMemo(() => {
2026-07-20 16:05:17 +00:00
let title;
2026-07-29 08:29:29 +00:00
if (embed != null) {
2026-07-20 16:05:17 +00:00
title = embed.title;
}
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != title) {
2026-07-29 08:29:29 +00:00
const obj = { style: null, variant: "text-xs/semibold", color: "mobile-text-heading-primary", lineClamp: 1, ellipsizeMode: "tail", children: null };
obj[0] = { marginVertical: 1 };
obj[5] = title;
2026-08-24 06:08:38 +00:00
tmp2 = closure_1_5(embed(isLoadingEmbed[6]).Text, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items3);
const items4 = [embed, memo3];
[][0] = embed;
const memo4 = React.useMemo(() => {
2026-07-29 08:29:29 +00:00
if (embed != null) {
2026-07-20 16:05:17 +00:00
const description = embed.description;
}
2026-07-29 08:29:29 +00:00
let tmp = null;
2026-07-20 16:05:17 +00:00
if (null == memo3) {
2026-07-29 08:29:29 +00:00
tmp = null;
2026-07-20 16:05:17 +00:00
if (null != description) {
2026-07-29 08:29:29 +00:00
const obj = { style: null, variant: "text-xs/medium", color: "text-default", lineClamp: 1, ellipsizeMode: "tail", children: null };
obj[0] = { marginVertical: 1 };
obj[5] = description;
2026-08-24 06:08:38 +00:00
tmp = closure_1_5(embed(isLoadingEmbed[6]).Text, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
}, items4);
if (null != embed) {
const items5 = [tmp.container, ];
let containerRevamp;
if (embed.isRevamp) {
containerRevamp = tmp.containerRevamp;
}
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
2026-07-20 16:05:17 +00:00
items5[1] = containerRevamp;
2026-07-29 08:29:29 +00:00
obj[0] = items5;
2026-07-20 16:05:17 +00:00
if (!isLoadingEmbed) {
2026-07-29 08:29:29 +00:00
let tmp9Result = null != memo;
if (tmp9Result) {
obj = { style: null, source: null, resizeMode: "cover" };
obj[0] = tmp.thumbnail;
obj[1] = memo;
tmp9Result = tmp9(memo3, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { children: null };
const items6 = [tmp9Result, ];
2026-08-24 06:08:38 +00:00
obj1 = { style: null, children: null };
2026-07-29 08:29:29 +00:00
obj1[0] = tmp.contentContainer;
2026-07-20 16:05:17 +00:00
const items7 = [memo2, memo3, memo4, tmp7];
2026-07-29 08:29:29 +00:00
obj1[1] = items7;
items6[1] = closure_6(tmp10, obj1);
obj[0] = items6;
memo1 = tmp12(closure_7, obj);
2026-07-20 16:05:17 +00:00
const tmp13 = closure_7;
}
2026-07-29 08:29:29 +00:00
obj[1] = memo1;
tmp9Result = tmp9(tmp10, obj);
2026-07-20 16:05:17 +00:00
} else {
tmp9Result = null;
}
return tmp9Result;
};