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

68 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 16203
// Function ID: 16204
2026-07-20 16:05:17 +00:00
// Name: renderChannelBadge
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 21, 1297, 11463, 4734, 1236, 1898, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-15 05:55:55 +00:00
// Module 16203 (renderChannelBadge)
2026-07-29 08:29:29 +00:00
import "noop";
2026-07-23 10:11:24 +00:00
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) {
2026-07-29 08:29:29 +00:00
let obj = { value: null, isMentionLowImportance: null };
obj[0] = num;
obj[1] = tmp;
let tmp2 = jsx(require(1297) /* Button */.Badge, { value: null, isMentionLowImportance: null });
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
if (flag) {
2026-08-15 05:55:55 +00:00
tmp2 = jsx(importDefault(11463), {});
2026-07-20 16:05:17 +00:00
} else {
if (null != newPostCount) {
if (newPostCount > 0) {
2026-07-29 08:29:29 +00:00
obj = { variant: "text-xs/bold", color: "text-brand", children: null };
const intl = require(1236) /* getSystemLocale */.intl;
const obj1 = { count: null };
2026-08-11 06:20:06 +00:00
obj1[0] = require(1898) /* shortenAndLocalizeNumber */.humanizeValue(newPostCount, newChannel.locale);
2026-07-29 08:29:29 +00:00
obj[2] = intl.format(require(1236) /* getSystemLocale */.t.GkAbqY, obj1);
2026-08-15 05:55:55 +00:00
tmp2 = jsx(require(4734) /* Text */.Text, { variant: "text-xs/bold", color: "text-brand", children: null });
2026-08-11 06:20:06 +00:00
const obj5 = require(1898) /* shortenAndLocalizeNumber */;
2026-07-20 16:05:17 +00:00
}
}
if (null != postsWithUnreadsCount) {
if (postsWithUnreadsCount > 0) {
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "text-xs/bold", color: "text-muted", children: null };
obj2[2] = postsWithUnreadsCount;
2026-08-15 05:55:55 +00:00
tmp2 = jsx(require(4734) /* Text */.Text, { variant: "text-xs/bold", color: "text-muted", children: null });
2026-07-20 16:05:17 +00:00
}
}
tmp2 = null;
if (null != eventsMentionCount) {
tmp2 = null;
if (eventsMentionCount > 0) {
2026-07-29 08:29:29 +00:00
obj = { value: null, eventsMentionBadge: true };
obj[0] = eventsMentionCount;
tmp2 = jsx(require(1297) /* Button */.Badge, { value: null, eventsMentionBadge: true });
2026-07-20 16:05:17 +00:00
}
}
}
};