Files
discord-decomp/modules/channel/native/openChannelPicker.tsx
T
2026-11-01 12:12:55 +02:00

23 lines
859 B
TypeScript

// Metro module 10401 (f10402).
import GuildChannelStore from "../../../stores/GuildChannelStore";
import GuildStore from "../../../stores/GuildStore";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../intl/index.native";
export default function openChannelPicker({ selectedChannel, guildId, channelType, filterFn = () => true, onClose, ...rest }) {
const guild = GuildStore.getGuild(guildId);
let r24 = GuildChannelStore.getChannels(guildId)[channelType];
if (r24 == null) {
r24 = [];
}
ActionSheetActionCreators.openLazy(import("./ChannelPickerActionSheet"), "ChannelPicker", {
header: {
title: intl.string(t.r2ptsz),
onClose
},
guild,
channels: r24.filter(filterFn).map((item) => item.channel),
selectedChannel,
...rest
});
};