diff --git a/src/components/Config/ConfigChanger.tsx b/src/components/Config/ConfigChanger.tsx deleted file mode 100644 index 8613660ae..000000000 --- a/src/components/Config/ConfigChanger.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { Center, Dialog, Loader, Notification, Select, Tooltip } from '@mantine/core'; -import { useToggle } from '@mantine/hooks'; -import { notifications } from '@mantine/notifications'; -import { IconCheck } from '@tabler/icons-react'; -import { setCookie } from 'cookies-next'; -import { useTranslation } from 'next-i18next'; -import { useRouter } from 'next/router'; -import { useState } from 'react'; -import { api } from '~/utils/api'; - -import { useConfigContext } from '../../config/provider'; - -export default function ConfigChanger() { - const router = useRouter(); - - const { t } = useTranslation('settings/general/config-changer'); - const { name: configName, setConfigName } = useConfigContext(); - - const { data: configs, isLoading } = useConfigsQuery(); - const [activeConfig, setActiveConfig] = useState(configName); - const [isRefreshing, toggle] = useToggle(); - - const onConfigChange = (value: string) => { - setCookie('config-name', value ?? 'default', { - maxAge: 60 * 60 * 24 * 30, - sameSite: 'strict', - }); - setActiveConfig(value); - - notifications.show({ - id: 'load-data', - loading: true, - title: t('configSelect.loadingNew'), - radius: 'md', - withCloseButton: false, - message: t('configSelect.pleaseWait'), - autoClose: false, - }); - - setTimeout(() => { - notifications.update({ - id: 'load-data', - color: 'teal', - radius: 'md', - withCloseButton: false, - title: t('configSelect.loadingNew'), - message: t('configSelect.pleaseWait'), - icon: , - autoClose: 2000, - }); - }, 3000); - setTimeout(() => { - router.push(`/${value}`); - setConfigName(value); - }, 500); - }; - - // If configlist is empty, return a loading indicator - if (isLoading || !configs || configs.length === 0 || !configName) { - return ( - -
- -
-
- ); - } - - return ( - <> -