forked from imodeljs/imodeljs-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tree.tsx
29 lines (26 loc) · 1.26 KB
/
Tree.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from "react";
import { IModelConnection } from "@bentley/imodeljs-frontend";
import { Tree } from "@bentley/ui-components";
import { PresentationTreeDataProvider, treeWithUnifiedSelection } from "@bentley/presentation-components";
// create a HOC tree component that supports unified selection
// tslint:disable-next-line:variable-name
const SimpleTree = treeWithUnifiedSelection(Tree);
/** React properties for the tree component */
export interface Props {
/** iModel whose contents should be displayed in the tree */
imodel: IModelConnection;
/** ID of the presentation rule set to use for creating the hierarchy in the tree */
rulesetId: string;
}
/** Tree component for the viewer app */
export default class SimpleTreeComponent extends React.Component<Props> {
public render() {
return (
<SimpleTree dataProvider={new PresentationTreeDataProvider(this.props.imodel, this.props.rulesetId)} />
);
}
}