/** * Copyright (c) Facebook, Inc. and its 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 React, {Fragment, useContext} from 'react'; import {ProfilerContext} from './ProfilerContext'; import {formatDuration, formatTime} from './utils'; import {StoreContext} from '../context'; import styles from './SidebarCommitInfo.css'; export type Props = {||}; export default function SidebarCommitInfo(_: Props) { const { selectedCommitIndex, rootID, selectInteraction, selectTab, } = useContext(ProfilerContext); const {profilerStore} = useContext(StoreContext); if (rootID === null || selectedCommitIndex === null) { return
Nothing selected
; } const {interactions} = profilerStore.getDataForRoot(rootID); const { duration, interactionIDs, priorityLevel, timestamp, } = profilerStore.getCommitData(rootID, selectedCommitIndex); const viewInteraction = interactionID => { selectTab('interactions'); selectInteraction(interactionID); }; return (
Commit information
); }