import React, { useState, useCallback } from 'react'; import { Stack } from '@fluentui/react/lib/Stack'; import { DefaultButton } from '@fluentui/react/lib/Button'; import LogPanel from '@components/nav/slideNav/LogPanel'; import { Important, Cancel } from '@components/fluent/Icon'; import { EXPERIMENT } from '@static/datamodel'; import '@style/nav/slideNavBtns.scss'; export const ErrorMessage: React.FunctionComponent = () => { const [hideDialog, setHideDialog] = useState(EXPERIMENT.status === 'ERROR' ? true : false); const [isShowLogPanel, setShowLogPanel] = useState(false); const closeLogPanel = useCallback(() => setShowLogPanel(false), []); const ShowLogPanel = useCallback(() => setShowLogPanel(true), []); return ( <> {hideDialog ? (
{Important}
Error
setHideDialog(false)}> {Cancel}
{EXPERIMENT.error}
{/* learn about click -> default active key is dispatcher. */} {isShowLogPanel ? : null}
) : null} ); };