Files
planet/frontend/public/earth/js/tv-source-menu.js
T

30 lines
870 B
JavaScript

import { createHUDSelectMenu } from "./hud-select-menu.js";
import { earthMessage, formatEarthMessage } from "./i18n.js";
export function createTVSourceMenu({ triggers, onSelect, loadPage, formatSource }) {
return createHUDSelectMenu({
id: "tv-source-menu",
triggers,
onSelect,
loadPage,
formatSource,
searchable: true,
showCount: true,
labels: {
menu: "选择新闻直播源",
list: "频道列表",
search: "搜索频道、地区…",
empty: "暂无可用频道",
noMatch: "无匹配频道",
unavailable: "暂无可用频道",
defaultLabel: "默认",
loading: "正在加载频道…",
loadFailed: "加载频道失败,点击重试",
count: ({ count, total }) => formatEarthMessage(earthMessage("tv.channelResults", {
count,
total,
})),
},
});
}