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 AccountSettings from 'components/settings/AccountSettings';
import ProfileSettings from 'components/settings/ProfileSettings';
import useUser from 'hooks/useUser';
const WEBSITES = '/settings';
const ACCOUNTS = '/settings/accounts';
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?.is_admin,
},
{
label: ,
value: PROFILE,
},
];
return (
{pathname === WEBSITES && }
{pathname === ACCOUNTS && }
{pathname === PROFILE && }
);
}