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

120 lines
4.5 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11929
// Function ID: 92329
2026-07-20 16:05:17 +00:00
// Name: TimestampBadge
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 27, 653, 33, 4131, 11930, 5972, 6556, 9001, 9006, 8867, 11932, 11933, 689, 11934, 7853, 4647, 4127, 10871, 2]
2026-07-20 16:05:17 +00:00
// Exports: EpisodeBadge, PartyBadge, TimestampBadge
2026-07-27 11:26:19 +00:00
// Module 11929 (TimestampBadge)
2026-07-23 10:11:24 +00:00
import "result";
import { View } from "get ActivityIndicator";
import { ActivityTypes } from "ME";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_5;
let closure_6;
const require = arg1;
({ jsx: closure_5, jsxs: closure_6 } = jsxProd);
let closure_7 = _createForOfIteratorHelperLoose.createStyles({ container: { display: "flex", flexDirection: "row", alignItems: "center", gap: 4 }, bold: { fontWeight: "bold" } });
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-07-27 11:26:19 +00:00
let obj = require(11932) /* dropMilliseconds */;
2026-07-20 16:05:17 +00:00
const timestamps = activity.timestamps;
let start;
if (null != timestamps) {
start = timestamps.start;
}
if (null == start) {
start = activity.created_at;
}
if (null != start) {
2026-07-27 11:26:19 +00:00
if (!importDefault(11933)(activity)) {
2026-07-20 16:05:17 +00:00
const timestamps2 = activity.timestamps;
let end;
if (null != timestamps2) {
end = timestamps2.end;
}
const timestamps3 = activity.timestamps;
let isCountDown;
if (null != timestamps3) {
isCountDown = timestamps3.isCountDown;
}
let flag = tmp5;
if (null != isCountDown && isCountDown) {
flag = null != end;
}
if (flag) {
flag = end > obj.useTimestampTickedNow().now;
}
if (flag === undefined) {
flag = false;
}
if (flag) {
2026-07-27 11:26:19 +00:00
let GameControllerIcon = require(11930) /* HourglassIcon */.HourglassIcon;
2026-07-25 08:10:48 +00:00
} else if (importDefault(5972)(activity)) {
GameControllerIcon = require(6556) /* AppsIcon */.AppsIcon;
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.WATCHING) {
2026-07-25 08:10:48 +00:00
GameControllerIcon = require(9001) /* TvIcon */.TvIcon;
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.LISTENING) {
2026-07-25 08:10:48 +00:00
GameControllerIcon = require(9006) /* MusicIcon */.MusicIcon;
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
GameControllerIcon = require(8867) /* GameControllerIcon */.GameControllerIcon;
2026-07-20 16:05:17 +00:00
}
obj = { style: tmp.container };
2026-07-23 10:11:24 +00:00
obj = { size: "xxs", color: importDefault(689).colors.TEXT_FEEDBACK_POSITIVE };
2026-07-20 16:05:17 +00:00
const items = [callback(GameControllerIcon, obj), ];
const obj1 = {};
const obj2 = { start, end, isCountDown: null != isCountDown && isCountDown };
obj1.entry = obj2;
obj1.style = tmp.bold;
2026-07-27 11:26:19 +00:00
items[1] = callback(require(11934) /* ActiveTimestamp */.ActiveTimestamp, obj1);
2026-07-20 16:05:17 +00:00
obj.children = items;
return callback2(View, obj);
}
}
return null;
};
export const PartyBadge = function PartyBadge(activity) {
activity = activity.activity;
2026-07-25 08:10:48 +00:00
if (!importDefault(5972)(activity)) {
2026-07-20 16:05:17 +00:00
if (null != activity.party) {
2026-07-25 08:10:48 +00:00
const richGameStateBadgeText = require(7853) /* calculateTimestampDurations */.getRichGameStateBadgeText(activity.state, activity.party);
2026-07-20 16:05:17 +00:00
let tmp9 = null;
if (null != richGameStateBadgeText) {
let obj = { style: tmp.container };
2026-07-23 10:11:24 +00:00
obj = { size: "xxs", color: importDefault(689).colors.TEXT_MUTED };
2026-07-25 08:10:48 +00:00
const items = [callback(require(4647) /* GroupIcon */.GroupIcon, obj), ];
2026-07-23 10:11:24 +00:00
obj = { variant: "text-sm/medium", color: "text-muted", children: richGameStateBadgeText };
2026-07-25 08:10:48 +00:00
items[1] = callback(require(4127) /* Text */.Text, obj);
2026-07-20 16:05:17 +00:00
obj.children = items;
tmp9 = callback2(View, obj);
}
return tmp9;
}
}
return null;
};
export const EpisodeBadge = function EpisodeBadge(activity) {
2026-07-25 08:10:48 +00:00
let obj = require(7853) /* calculateTimestampDurations */;
2026-07-20 16:05:17 +00:00
const assets = activity.activity.assets;
let large_text;
if (null != assets) {
large_text = assets.large_text;
}
const episodeBadgeText = obj.getEpisodeBadgeText(large_text);
let tmp4 = null;
if (null != episodeBadgeText) {
obj = { style: tmp.container };
2026-07-23 10:11:24 +00:00
obj = { size: "xxs", color: importDefault(689).colors.TEXT_MUTED };
2026-07-27 11:26:19 +00:00
const items = [callback(require(10871) /* TopicsIcon */.TopicsIcon, obj), ];
2026-07-23 10:11:24 +00:00
const obj1 = { variant: "text-sm/medium", color: "text-muted", children: episodeBadgeText };
2026-07-25 08:10:48 +00:00
items[1] = callback(require(4127) /* Text */.Text, obj1);
2026-07-20 16:05:17 +00:00
obj.children = items;
tmp4 = callback2(View, obj);
}
return tmp4;
};