/** * 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. * * @format */ import React from 'react'; // eslint-disable-next-line rulesdir/no-restricted-imports-clone import {Glyph} from 'flipper'; import { Layout, Tab, Tabs, theme, usePlugin, useValue, TimelineDataDescription, } from 'flipper-plugin'; import {Id, Metadata, MetadataId, UINode} from '../../types'; import {IdentityInspector} from './inspector/IdentityInspector'; import {AttributesInspector} from './inspector/AttributesInspector'; import {Tooltip} from 'antd'; import {NoData} from './inspector/NoData'; import {plugin} from '../../index'; type Props = { nodes: Map; metadata: Map; }; export const Inspector: React.FC = ({nodes, metadata}) => { const instance = usePlugin(plugin); const selectedNodeId = useValue(instance.uiState.selectedNode); const frameworkEvents = useValue(instance.frameworkEvents); const selectedNode = selectedNodeId ? nodes.get(selectedNodeId) : undefined; if (!selectedNode) { return ; } const events = selectedNodeId ? frameworkEvents?.get(selectedNodeId) : undefined; return ( }> }> }> {events && ( }> { return { moment: e.timestamp, display: e.type.slice(e.type.lastIndexOf(':') + 1), color: theme.primaryColor, key: e.timestamp.toString(), }; }), current: '', }} /> )} ); };