decord/source/modules/user_profile/native/UserProfileActivityBadges.tsx
2026-07-23 10:11:24 +00:00

119 lines
4.5 KiB
TypeScript

// Module ID: 11926
// Function ID: 92283
// Name: TimestampBadge
// Dependencies: [31, 27, 653, 33, 4130, 11927, 6982, 9075, 9070, 9076, 8940, 11929, 11930, 689, 11931, 7815, 4646, 4126, 10893, 2]
// Exports: EpisodeBadge, PartyBadge, TimestampBadge
// Module 11926 (TimestampBadge)
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");
export const TimestampBadge = function TimestampBadge(activity) {
activity = activity.activity;
const tmp = callback3();
let obj = require(11929) /* dropMilliseconds */;
const timestamps = activity.timestamps;
let start;
if (null != timestamps) {
start = timestamps.start;
}
if (null == start) {
start = activity.created_at;
}
if (null != start) {
if (!importDefault(11930)(activity)) {
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) {
let GameControllerIcon = require(11927) /* HourglassIcon */.HourglassIcon;
} else if (importDefault(6982)(activity)) {
GameControllerIcon = require(9075) /* AppsIcon */.AppsIcon;
} else if (activity.type === ActivityTypes.WATCHING) {
GameControllerIcon = require(9070) /* TvIcon */.TvIcon;
} else if (activity.type === ActivityTypes.LISTENING) {
GameControllerIcon = require(9076) /* MusicIcon */.MusicIcon;
} else {
GameControllerIcon = require(8940) /* GameControllerIcon */.GameControllerIcon;
}
obj = { style: tmp.container };
obj = { size: "xxs", color: importDefault(689).colors.TEXT_FEEDBACK_POSITIVE };
const items = [callback(GameControllerIcon, obj), ];
const obj1 = {};
const obj2 = { start, end, isCountDown: null != isCountDown && isCountDown };
obj1.entry = obj2;
obj1.style = tmp.bold;
items[1] = callback(require(11931) /* ActiveTimestamp */.ActiveTimestamp, obj1);
obj.children = items;
return callback2(View, obj);
}
}
return null;
};
export const PartyBadge = function PartyBadge(activity) {
activity = activity.activity;
if (!importDefault(6982)(activity)) {
if (null != activity.party) {
const richGameStateBadgeText = require(7815) /* calculateTimestampDurations */.getRichGameStateBadgeText(activity.state, activity.party);
let tmp9 = null;
if (null != richGameStateBadgeText) {
let obj = { style: tmp.container };
obj = { size: "xxs", color: importDefault(689).colors.TEXT_MUTED };
const items = [callback(require(4646) /* GroupIcon */.GroupIcon, obj), ];
obj = { variant: "text-sm/medium", color: "text-muted", children: richGameStateBadgeText };
items[1] = callback(require(4126) /* Text */.Text, obj);
obj.children = items;
tmp9 = callback2(View, obj);
}
return tmp9;
}
}
return null;
};
export const EpisodeBadge = function EpisodeBadge(activity) {
let obj = require(7815) /* calculateTimestampDurations */;
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 };
obj = { size: "xxs", color: importDefault(689).colors.TEXT_MUTED };
const items = [callback(require(10893) /* TopicsIcon */.TopicsIcon, obj), ];
const obj1 = { variant: "text-sm/medium", color: "text-muted", children: episodeBadgeText };
items[1] = callback(require(4126) /* Text */.Text, obj1);
obj.children = items;
tmp4 = callback2(View, obj);
}
return tmp4;
};