/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { type HasContainerKey, VisualNodeKind } from "@fluidframework/devtools-core/internal"; import type { ReactNode } from "react"; import type { DataVisualizationTreeProps } from "./CommonInterfaces.js"; import { FluidHandleView } from "./FluidHandleView.js"; import { FluidTreeView } from "./FluidTreeView.js"; import { FluidValueView } from "./FluidValueView.js"; import { TreeView } from "./TreeView.js"; import { UnknownDataView } from "./UnknownDataView.js"; import { UnknownFluidObjectView } from "./UnknownFluidObjectView.js"; import { ValueView } from "./ValueView.js"; /** * {@link TreeDataView} input props. */ export interface TreeDataViewProps extends HasContainerKey, DataVisualizationTreeProps {} /** * Displays visual summary trees for DDS_s within the container based on the current node's type. */ export function TreeDataView(props: TreeDataViewProps): ReactNode { const { containerKey, label, node } = props; switch (node.nodeKind) { /** * Node with children. */ case VisualNodeKind.TreeNode: { return ; } /** * FluidObjectNode with children. */ case VisualNodeKind.FluidTreeNode: { return ; } /** * Node with primitive value. */ case VisualNodeKind.ValueNode: { return ; } /** * FluidObjectNode with primitive value. */ case VisualNodeKind.FluidValueNode: { return ; } /** * Unknown data type. */ case VisualNodeKind.UnknownObjectNode: { return ; } /** * Unknown SharedObject data type. */ case VisualNodeKind.FluidUnknownObjectNode: { return ; } /** * POST request to FluidClientDebugger. */ case VisualNodeKind.FluidHandleNode: { return ( ); } default: { console.log("DevTools hit unknown data. This is NOT expected."); return null; } } }