/* * Vencord, a Discord client mod * Copyright (c) 2025 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import SettingsPlugin from "@plugins/_core/settings"; import { EquicordDevs } from "@utils/constants"; import definePlugin, { StartAt } from "@utils/types"; import { openUserSettingsPanel } from "@webpack/common"; import ComponentsTab from "./components/ComponentsTab"; function ComponentsIcon(props: React.SVGProps) { return ( ); } export default definePlugin({ name: "Components", description: "Adds a new tab to settings to browse Discord components.", authors: [EquicordDevs.Prism], dependencies: ["Settings"], startAt: StartAt.WebpackReady, toolboxActions: { "Open Components Tab"() { openUserSettingsPanel("equicord_components"); }, }, start() { const { customEntries, customSections } = SettingsPlugin; customEntries.push({ key: "equicord_components", title: "Components", Component: ComponentsTab, Icon: ComponentsIcon }); customSections.push(() => ({ section: "EquicordDiscordComponents", label: "Components", element: ComponentsTab, className: "vc-discord-components", id: "Components" })); }, stop() { const { customEntries, customSections } = SettingsPlugin; const entryIdx = customEntries.findIndex(e => e.key === "equicord_components"); const sectionIdx = customSections.findIndex(s => s({} as any).id === "Components"); if (entryIdx !== -1) customEntries.splice(entryIdx, 1); if (sectionIdx !== -1) customSections.splice(sectionIdx, 1); }, });