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

71 lines
2.4 KiB
TypeScript
Raw Normal View History

// Module ID: 16984
// Function ID: 16985
2026-07-20 16:05:17 +00:00
// Name: renderChannelBadge
// Dependencies: [19, 21, 1178, 12296, 4556, 1114, 1880, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 16984 (renderChannelBadge)
2026-08-24 06:08:38 +00:00
import noopAll from "noop" /* 19 */;
import getSystemLocale from "getSystemLocale" /* 1114 */;
import Button from "Button" /* 1178 */;
import shortenAndLocalizeNumber from "shortenAndLocalizeNumber" /* 1880 */;
import Text from "Text" /* 4556 */;
import NewBadgeDefault from "NewBadge" /* 12296 */;
2026-08-24 06:08:38 +00:00
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
noopAll;
const result = require("set").fileFinishedImporting("modules/launchpad/native/shared/renderChannelBadge.tsx");
2026-07-20 16:05:17 +00:00
export default function renderChannelBadge(newChannel) {
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;
2026-08-24 06:08:38 +00:00
let tmp2 = jsx(Button.Badge, { value: null, isMentionLowImportance: null });
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
if (flag) {
2026-08-24 06:08:38 +00:00
tmp2 = jsx(NewBadgeDefault, {});
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 };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj1 = { count: null };
obj1[0] = shortenAndLocalizeNumber.humanizeValue(newPostCount, newChannel.locale);
obj[2] = intl.format(getSystemLocale.t.GkAbqY, obj1);
tmp2 = jsx(Text.Text, { variant: "text-xs/bold", color: "text-brand", children: null });
const obj5 = 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-24 06:08:38 +00:00
tmp2 = jsx(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;
2026-08-24 06:08:38 +00:00
tmp2 = jsx(Button.Badge, { value: null, eventsMentionBadge: true });
2026-07-20 16:05:17 +00:00
}
}
}
};