import { useAwaiter } from "../utils/misc"; import Plugins from 'plugins'; import { useSettings } from "../api/settings"; import IpcEvents from "../utils/IpcEvents"; import { Button, ButtonProps, Flex, Switch, Forms } from "../webpack/common"; import ErrorBoundary from "./ErrorBoundary"; export default ErrorBoundary.wrap(function Settings(props) { const [settingsDir, , settingsDirPending] = useAwaiter(() => VencordNative.ipc.invoke(IpcEvents.GET_SETTINGS_DIR), "Loading..."); const settings = useSettings(); return ( SettingsDir: {settingsDir} Settings settings.unsafeRequire = v} note="Enables VencordNative.require. Useful for testing, very bad for security. Leave this off unless you need it." > Enable Ensafe Require Plugins {Plugins.map(p => ( { settings.plugins[p.name].enabled = v; if (v) { p.dependencies?.forEach(d => { settings.plugins[d].enabled = true; }); } }} note={p.description} tooltipNote={p.required ? "This plugin is required. Thus you cannot disable it." : undefined} > {p.name} )) } ); });