/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import * as React from 'react'; import {Fragment, useContext} from 'react'; import {ProfilerContext} from './ProfilerContext'; import Updaters from './Updaters'; import {formatDuration, formatTime} from './utils'; import {StoreContext} from '../context'; import {getCommitTree} from './CommitTreeBuilder'; import styles from './SidebarCommitInfo.css'; export type Props = {}; export default function SidebarCommitInfo(_: Props): React.Node { const {selectedCommitIndex, rootID} = useContext(ProfilerContext); const {profilerStore} = useContext(StoreContext); if (rootID === null || selectedCommitIndex === null) { return
Nothing selected
; } const { duration, effectDuration, passiveEffectDuration, priorityLevel, timestamp, updaters, } = profilerStore.getCommitData(rootID, selectedCommitIndex); const hasCommitPhaseDurations = effectDuration !== null || passiveEffectDuration !== null; const commitTree = updaters !== null ? getCommitTree({ commitIndex: selectedCommitIndex, profilerStore, rootID, }) : null; return (
Commit information
); }