decord/source/modules/user_profile/native/UserProfileActivityBadges.tsx

134 lines
4.5 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 12102
// Function ID: 12103
2026-07-20 16:05:17 +00:00
// Name: TimestampBadge
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 17, 676, 21, 4661, 11400, 7259, 7974, 9899, 9904, 9430, 12103, 12104, 712, 12105, 8348, 6884, 4734, 10840, 2]
2026-07-20 16:05:17 +00:00
// Exports: EpisodeBadge, PartyBadge, TimestampBadge
2026-08-15 05:55:55 +00:00
// Module 12102 (TimestampBadge)
2026-07-29 08:29:29 +00:00
import "set";
import { View } from "Text";
2026-07-23 10:11:24 +00:00
import { ActivityTypes } from "ME";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c5, jsxs: closure_6 } = jsxProd);
let closure_7 = createCacheKey.createStyles({ container: { display: "flex", flexDirection: "row", alignItems: "center", gap: 4 }, bold: { fontWeight: "bold" } });
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("modules/user_profile/native/UserProfileActivityBadges.tsx");
2026-07-20 16:05:17 +00:00
export const TimestampBadge = function TimestampBadge(activity) {
activity = activity.activity;
const tmp = callback3();
2026-08-15 05:55:55 +00:00
let obj = require(12103) /* useTimestampTickedNow */;
2026-07-20 16:05:17 +00:00
const timestamps = activity.timestamps;
let start;
2026-07-29 08:29:29 +00:00
if (timestamps != null) {
2026-07-20 16:05:17 +00:00
start = timestamps.start;
}
2026-07-29 08:29:29 +00:00
if (start == null) {
2026-07-20 16:05:17 +00:00
start = activity.created_at;
}
if (null != start) {
2026-08-15 05:55:55 +00:00
if (!importDefault(12104)(activity)) {
2026-07-20 16:05:17 +00:00
const timestamps2 = activity.timestamps;
let end;
2026-07-29 08:29:29 +00:00
if (timestamps2 != null) {
2026-07-20 16:05:17 +00:00
end = timestamps2.end;
}
const timestamps3 = activity.timestamps;
2026-07-29 08:29:29 +00:00
let flag;
if (timestamps3 != null) {
flag = timestamps3.isCountDown;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag2 = flag;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
flag2 = null != end;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag2) {
flag2 = end > obj.useTimestampTickedNow().now;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag2 === undefined) {
flag2 = false;
}
if (flag2) {
2026-08-15 05:55:55 +00:00
let GameControllerIcon = tmp2(11400).HourglassIcon;
} else if (tmp10(7259)(activity)) {
GameControllerIcon = tmp2(7974).AppsIcon;
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.WATCHING) {
2026-08-15 05:55:55 +00:00
GameControllerIcon = tmp2(9899).TvIcon;
2026-07-29 08:29:29 +00:00
} else if (activity.type === tmp6.LISTENING) {
2026-08-15 05:55:55 +00:00
GameControllerIcon = tmp2(9904).MusicIcon;
2026-07-20 16:05:17 +00:00
} else {
2026-08-15 05:55:55 +00:00
GameControllerIcon = tmp2(9430).GameControllerIcon;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
obj[1] = tmp10(712).colors.TEXT_FEEDBACK_POSITIVE;
2026-07-20 16:05:17 +00:00
const items = [callback(GameControllerIcon, obj), ];
2026-07-29 08:29:29 +00:00
const obj1 = { entry: null, style: null };
const obj2 = { start: null, end: null, isCountDown: null };
obj2[0] = start;
obj2[1] = end;
obj2[2] = flag;
obj1[0] = obj2;
obj1[1] = tmp.bold;
2026-08-15 05:55:55 +00:00
items[1] = callback(tmp2(12105).ActiveTimestamp, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
}
}
return null;
};
export const PartyBadge = function PartyBadge(activity) {
activity = activity.activity;
2026-08-15 05:55:55 +00:00
if (!importDefault(7259)(activity)) {
2026-07-20 16:05:17 +00:00
if (null != activity.party) {
2026-08-15 05:55:55 +00:00
const richGameStateBadgeText = require(8348) /* calculateTimestampDurations */.getRichGameStateBadgeText(activity.state, activity.party);
2026-07-29 08:29:29 +00:00
let tmp8 = null;
2026-07-20 16:05:17 +00:00
if (null != richGameStateBadgeText) {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
obj[1] = importDefault(712).colors.TEXT_MUTED;
2026-08-15 05:55:55 +00:00
const items = [callback(tmp9(6884).GroupIcon, obj), ];
2026-07-29 08:29:29 +00:00
obj = { variant: "text-sm/medium", color: "text-muted", children: null };
obj[2] = richGameStateBadgeText;
2026-08-15 05:55:55 +00:00
items[1] = callback(tmp9(4734).Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items;
tmp8 = callback2(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
}
}
return null;
};
export const EpisodeBadge = function EpisodeBadge(activity) {
2026-08-15 05:55:55 +00:00
let obj = require(8348) /* calculateTimestampDurations */;
2026-07-20 16:05:17 +00:00
const assets = activity.activity.assets;
let large_text;
2026-07-29 08:29:29 +00:00
if (assets != null) {
2026-07-20 16:05:17 +00:00
large_text = assets.large_text;
}
const episodeBadgeText = obj.getEpisodeBadgeText(large_text);
2026-07-29 08:29:29 +00:00
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (null != episodeBadgeText) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { size: "xxs", color: null };
obj[1] = importDefault(712).colors.TEXT_MUTED;
2026-08-15 05:55:55 +00:00
const items = [callback(tmp2(10840).TopicsIcon, obj), ];
2026-07-29 08:29:29 +00:00
const obj1 = { variant: "text-sm/medium", color: "text-muted", children: null };
obj1[2] = episodeBadgeText;
2026-08-15 05:55:55 +00:00
items[1] = callback(tmp2(4734).Text, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
tmp6 = callback2(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
};