/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { ModalCloseButton, ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { Forms, Parser } from "@webpack/common"; import { GuildMember } from "discord-types/general"; const cl = classNameFactory("vc-inrole-"); export function showInRoleModal(members: GuildMember[], roleId: string, channelId: string) { openModal(props => <> Members of role { Parser.parse(`<@&${roleId}>`, true, { channelId, viewingChannelId: channelId }) } ({members.length})
{ members.length !== 0 ? members.map(member => <> {Parser.parse(`<@${member.userId}>`, true, { channelId, viewingChannelId: channelId })} ) : Looks like no online cached members with that role were found. Try scrolling down on your member list to cache more users! }
); }