//Lib import 'react-toastify/dist/ReactToastify.css'; import classes from './UserSettings.module.css'; import { useState, useEffect } from 'react'; //Components import EmailSettings from './EmailSettings/EmailSettings'; import PasswordSettings from './PasswordSettings/PasswordSettings'; import UsernameSettings from './UsernameSettings/UsernameSettings'; import EmailAlertSettings from './EmailAlertSettings/EmailAlertSettings'; import AppriseAlertSettings from './AppriseAlertSettings/AppriseAlertSettings'; import Integrations from './Integrations/Integrations'; import { SessionStatus } from '~/types/api/next-auth.types'; import { Session } from 'next-auth'; import { WizardEnvType } from '~/types/domain/config.types'; import { Optional } from '~/types'; type UserSettingsProps = { status: SessionStatus; data: Session; }; export default function UserSettings(props: UserSettingsProps) { //States const [tab, setTab] = useState('General'); const [wizardEnv, setWizardEnv] = useState>(); //ComponentDidMount useEffect(() => { const fetchWizardEnv = async () => { try { const response = await fetch('/api/account/getWizardEnv', { method: 'GET', headers: { 'Content-type': 'application/json', }, }); const data: { wizardEnv: WizardEnvType } = await response.json(); setWizardEnv(data.wizardEnv); } catch (error) { console.log('Fetching datas error'); } }; fetchWizardEnv(); }, []); return (

Account{' '}

{wizardEnv?.DISABLE_INTEGRATIONS !== 'true' && ( )}
{tab === 'General' && ( <> {' '} )} {tab === 'Notifications' && ( <> )} {tab === 'Integrations' && ( <> )}
); }