import React, { useState, useCallback } from 'react'; import { Stack, Callout, Link, IconButton } from '@fluentui/react'; import { useId } from '@uifabric/react-hooks'; import { EXPERIMENT } from '@static/datamodel'; import { formatTimestamp } from '@static/function'; import LogPanel from '@components/nav/slideNav/LogPanel'; import { BestMetricContext } from '../Overview'; import { styles } from './basicInfoStyles'; import '@style/common/experimentStatusColor.scss'; import '@style/experiment/overview/basic.scss'; export const BasicInfo = (): any => { const labelId: string = useId('callout-label'); const descriptionId: string = useId('callout-description'); const ref = React.createRef(); const [isCalloutVisible, setCalloutVisible] = useState(false); const [isShowLogPanel, setShowLogPanel] = useState(false); const onDismiss = useCallback(() => setCalloutVisible(false), []); const showCallout = useCallback(() => setCalloutVisible(true), []); const closeLogPanel = useCallback(() => setShowLogPanel(false), []); const ShowLogPanel = useCallback(() => setShowLogPanel(true), []); return (

Name

{EXPERIMENT.profile.params.experimentName || '--'}

ID

{EXPERIMENT.profile.id}

Status

{EXPERIMENT.status} {EXPERIMENT.status === 'ERROR' ? (
{isCalloutVisible && (

Error

{EXPERIMENT.error}

Learn more
)}
) : null}
{(value): React.ReactNode => (

Best metric

{isNaN(value.bestAccuracy) ? 'N/A' : value.bestAccuracy.toFixed(6)}
)}

Start time

{formatTimestamp(EXPERIMENT.profile.startTime)}

End time

{formatTimestamp(EXPERIMENT.profile.endTime)}
{/* learn about click -> default active key is dispatcher. */} {isShowLogPanel ? : null}
); };