import { useContext } from 'react' import { Descriptions, Button, Typography, Flex, Space, Dropdown, message } from 'antd' import ReloadIcon from '../../Icons/ReloadIcon.jsx' import { AuthContext } from '../context/AuthContext.jsx' import BoolDisplay from '../common/BoolDisplay.jsx' import DataTree from '../common/DataTree.jsx' const { Text } = Typography const AuthContextDebug = () => { const { authenticated, userProfile, loading, loginWithSSO, logout } = useContext(AuthContext) const [msgApi, contextHolder] = message.useMessage() const handleLogin = () => { loginWithSSO() } const handleLogout = () => { logout() } const actionItems = { items: [ { label: 'Log In', key: 'login', disabled: authenticated }, { label: 'Log Out', key: 'logout', disabled: !authenticated }, { label: 'Reload', key: 'reload', icon: } ], onClick: ({ key }) => { if (key === 'login') handleLogin() if (key === 'logout') handleLogout() if (key === 'reload') { msgApi.info('Reloading Auth State...') window.location.reload() } } } return ( {contextHolder} Actions {userProfile ? ( ) : ( n/a )} ) } export default AuthContextDebug
{userProfile ? ( ) : ( n/a )}