import { Button, Dropdown, Menu } from 'antd'; import React, { createContext, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router-dom'; import { useAPIClient, useCurrentUserContext } from '..'; import { ChangePassword } from './ChangePassword'; import { EditProfile } from './EditProfile'; import { LanguageSettings } from './LanguageSettings'; import { SwitchRole } from './SwitchRole'; export const DropdownVisibleContext = createContext(null); export const CurrentUser = () => { const history = useHistory(); const api = useAPIClient(); const { t } = useTranslation(); const [visible, setVisible] = useState(false); const { data } = useCurrentUserContext(); return (
{ setVisible(visible); }} overlay={ { api.setBearerToken(null); history.push('/signin'); }} > {t('Sign out')} } >
); };