import React, { useState } from 'react'; import { useRouter } from 'next/router'; import Page from 'components/layout/Page'; import MenuLayout from 'components/layout/MenuLayout'; import WebsiteSettings from '../settings/WebsiteSettings'; import AccountSettings from '../settings/AccountSettings'; import ProfileSettings from '../settings/ProfileSettings'; import { useSelector } from 'react-redux'; import { FormattedMessage } from 'react-intl'; const WEBSITES = '/settings'; const ACCOUNTS = '/settings/accounts'; const PROFILE = '/settings/profile'; export default function Settings() { const user = useSelector(state => state.user); const [option, setOption] = useState(WEBSITES); const router = useRouter(); const { pathname } = router; const menuOptions = [ { label: , value: WEBSITES, }, { label: , value: ACCOUNTS, hidden: !user.is_admin, }, { label: , value: PROFILE, }, ]; return ( {pathname === WEBSITES && } {pathname === ACCOUNTS && } {pathname === PROFILE && } ); }