import { Button, Card, Group, Menu, Switch, TextInput, useMantineTheme } from '@mantine/core'; import { useConfig } from '../../tools/state'; import { IModule } from './modules'; function getItems(module: IModule) { const { config, setConfig } = useConfig(); const enabledModules = config.modules ?? {}; const items: JSX.Element[] = []; if (module.options) { const keys = Object.keys(module.options); const values = Object.values(module.options); // Get the value and the name of the option const types = values.map((v) => typeof v.value); // Loop over all the types with a for each loop types.forEach((type, index) => { const optionName = `${module.title}.${keys[index]}`; const moduleInConfig = config.modules?.[module.title]; if (type === 'string') { items.push(
); } // TODO: Add support for other types if (type === 'boolean') { items.push(