import React, { useState } from 'react';
import { FormattedMessage } from 'react-intl';
import { useRouter } from 'next/router';
import Page from 'components/layout/Page';
import MenuLayout from 'components/layout/MenuLayout';
import WebsiteSettings from 'components/settings/WebsiteSettings';
import UserSettings from 'components/settings/UserSettings';
import ProfileSettings from 'components/settings/ProfileSettings';
import useUser from 'hooks/useUser';
const WEBSITES = '/settings';
const ACCOUNTS = '/settings/users';
const PROFILE = '/settings/profile';
export default function Settings() {
const { user } = useUser();
const [option, setOption] = useState(WEBSITES);
const router = useRouter();
const { pathname } = router;
if (!user) {
return null;
}
const menuOptions = [
{
label: ,
value: WEBSITES,
},
{
label: ,
value: ACCOUNTS,
hidden: !user?.isAdmin,
},
{
label: ,
value: PROFILE,
},
];
return (
{pathname === WEBSITES && }
{pathname === ACCOUNTS && }
{pathname === PROFILE && }
);
}