decord/source/modules/launchpad/native/shared/renderChannelBadge.tsx

63 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15713
// Function ID: 121149
2026-07-20 16:05:17 +00:00
// Name: renderChannelBadge
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 33, 1273, 11423, 4126, 1212, 1827, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 15713 (renderChannelBadge)
2026-07-23 10:11:24 +00:00
import "result";
import { jsx } from "jsxProd";
const require = arg1;
const result = require("Button").fileFinishedImporting("modules/launchpad/native/shared/renderChannelBadge.tsx");
2026-07-20 16:05:17 +00:00
export default function renderChannelBadge(newChannel) {
let eventsMentionCount;
let newPostCount;
let postsWithUnreadsCount;
let flag = newChannel.newChannel;
if (flag === undefined) {
flag = false;
}
let num = newChannel.mentionCount;
if (num === undefined) {
num = 0;
}
({ postsWithUnreadsCount, newPostCount, eventsMentionCount } = newChannel);
if (null != num) {
if (num > 0) {
let obj = { value: num, isMentionLowImportance: tmp };
2026-07-23 10:11:24 +00:00
let tmp2 = jsx(require(1273) /* Button */.Badge, { value: num, isMentionLowImportance: tmp });
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
if (flag) {
2026-07-24 07:16:23 +00:00
tmp2 = jsx(importDefault(11423), {});
2026-07-20 16:05:17 +00:00
} else {
if (null != newPostCount) {
if (newPostCount > 0) {
2026-07-23 10:11:24 +00:00
obj = { variant: "text-xs/bold", color: "text-brand" };
const intl = require(1212) /* getSystemLocale */.intl;
const obj1 = { count: require(1827) /* shortenAndLocalizeNumber */.humanizeValue(newPostCount, newChannel.locale) };
obj.children = intl.format(require(1212) /* getSystemLocale */.t.GkAbqY, obj1);
tmp2 = jsx(require(4126) /* Text */.Text, { variant: "text-xs/bold", color: "text-brand" });
const obj5 = require(1827) /* shortenAndLocalizeNumber */;
2026-07-20 16:05:17 +00:00
}
}
if (null != postsWithUnreadsCount) {
if (postsWithUnreadsCount > 0) {
2026-07-23 10:11:24 +00:00
const obj2 = { variant: "text-xs/bold", color: "text-muted", children: postsWithUnreadsCount };
tmp2 = jsx(require(4126) /* Text */.Text, { variant: "text-xs/bold", color: "text-muted", children: postsWithUnreadsCount });
2026-07-20 16:05:17 +00:00
}
}
tmp2 = null;
if (null != eventsMentionCount) {
tmp2 = null;
if (eventsMentionCount > 0) {
obj = { value: eventsMentionCount, eventsMentionBadge: true };
2026-07-23 10:11:24 +00:00
tmp2 = jsx(require(1273) /* Button */.Badge, { value: eventsMentionCount, eventsMentionBadge: true });
2026-07-20 16:05:17 +00:00
}
}
}
};