decord/source/modules/share/native/ShareEmbed.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

150 lines
5.2 KiB
TypeScript

// Module ID: 14010
// Function ID: 14011
// Name: ShareEmbed
// Dependencies: [19, 17, 21, 4638, 576, 5663, 4634, 2]
// Exports: default
// Module 14010 (ShareEmbed)
import nativeDefault from "native" /* 576 */;
import Text_Text from "Text/Text" /* 4634 */;
import ActivityIndicator_ActivityIndicator from "ActivityIndicator/ActivityIndicator" /* 5663 */;
import noop from "module_19" /* 19 */;
require = fn;
get_ActivityIndicator = fn(17);
({ Image: c3, View: closure_4 } = get_ActivityIndicator);
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire, Fragment: closure_7 } = jsxProd);
const createStyles = fn(4638);
let obj2 = { container: { flexDirection: "row", height: 80, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, borderColor: nativeDefault.colors.BORDER_STRONG, borderWidth: 1, borderRadius: nativeDefault.radii.sm, overflow: "hidden" }, containerRevamp: { borderWidth: 0 }, thumbnail: { width: 80 }, contentContainer: { flex: 1, flexDirection: "column", justifyContent: "center", paddingLeft: 12, paddingRight: 24 }, authorView: { flexDirection: "row", alignItems: "center", marginBottom: 3 }, authorThumbnail: null, loadingSpinner: null };
let size = { height: 16, width: 16, borderRadius: nativeDefault.radii.sm, marginRight: 4 };
obj2.authorThumbnail = size;
obj2.loadingSpinner = { flex: 1 };
let closure_8 = createStyles.createStyles(obj2);
size = fn(2);
const result = size.fileFinishedImporting("modules/share/native/ShareEmbed.tsx");
export default function ShareEmbed(embed) {
embed = embed.embed;
const isLoadingEmbed = embed.isLoadingEmbed;
let tmp = closure_8();
noop = tmp;
let items = [embed];
const memo = noop.useMemo(() => {
if (null != embed) {
const thumbnail = tmp.thumbnail;
let url;
if (thumbnail != null) {
url = thumbnail.url;
}
if (url == null) {
const image = tmp.image;
let url1;
if (image != null) {
url1 = image.url;
}
url = url1;
}
if (null != url) {
const obj = { uri: url };
return obj;
}
}
}, items);
const items1 = [isLoadingEmbed, tmp];
let memo1 = noop.useMemo(() => {
let tmp = null;
if (isLoadingEmbed) {
const obj = { style: closure_2.loadingSpinner };
tmp = hasOwnProperty(ActivityIndicator_ActivityIndicator.ActivityIndicator, obj);
}
return tmp;
}, items1);
const items2 = [embed, tmp];
const items3 = [embed];
const memo2 = noop.useMemo(() => {
let author;
if (embed != null) {
author = embed.author;
}
if (null == author) {
return null;
} else {
let icon_url = author.proxy_icon_url;
if (icon_url == null) {
icon_url = author.icon_url;
}
const obj = { style: closure_2.authorView, children: null };
let tmp5 = null != icon_url;
if (tmp5) {
const obj2 = { style: tmp4.authorThumbnail, source: null, resizeMode: "cover" };
const obj3 = { uri: icon_url };
obj2.source = obj3;
tmp5 = hasOwnProperty(React3, obj2);
}
const items = [tmp5, ];
const obj4 = { variant: "text-xs/semibold", color: "mobile-text-heading-primary", ellipsizeMode: "tail", lineClamp: 1, children: author.name };
items[1] = hasOwnProperty(Text_Text.Text, obj4);
obj.children = items;
return timestampProducer(React4, obj);
}
}, items2);
const memo3 = noop.useMemo(() => {
let title;
if (embed != null) {
title = embed.title;
}
let tmp2 = null;
if (null != title) {
const obj = { style: { marginVertical: 1 }, variant: "text-xs/semibold", color: "mobile-text-heading-primary", lineClamp: 1, ellipsizeMode: "tail", children: title };
tmp2 = hasOwnProperty(Text_Text.Text, obj);
}
return tmp2;
}, items3);
const items4 = [embed, memo3];
[][0] = embed;
const memo4 = noop.useMemo(() => {
if (embed != null) {
const description = embed.description;
}
let tmp = null;
if (null == memo3) {
tmp = null;
if (null != description) {
const obj = { style: { marginVertical: 1 }, variant: "text-xs/medium", color: "text-default", lineClamp: 1, ellipsizeMode: "tail", children: description };
tmp = hasOwnProperty(Text_Text.Text, obj);
}
}
return tmp;
}, items4);
if (null != embed) {
const items5 = [tmp.container, ];
let containerRevamp;
if (embed.isRevamp) {
containerRevamp = tmp.containerRevamp;
}
let obj = { style: null, children: null };
items5[1] = containerRevamp;
obj.style = items5;
if (!isLoadingEmbed) {
let tmp9Result = null != memo;
if (tmp9Result) {
let obj2 = { style: tmp.thumbnail, source: memo, resizeMode: "cover" };
tmp9Result = tmp9(memo3, obj2);
}
let obj3 = { children: null };
const items6 = [tmp9Result, ];
let obj4 = { style: tmp.contentContainer, children: null };
const items7 = [memo2, memo3, memo4, tmp7];
obj4.children = items7;
items6[1] = closure_6(tmp10, obj4);
obj3.children = items6;
memo1 = tmp12(closure_7, obj3);
}
obj.children = memo1;
let tmp9Result2 = tmp9(tmp10, obj);
} else {
tmp9Result2 = null;
}
return tmp9Result2;
};