1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import List from "@material-ui/core/List/List";
7 import ListItem from "@material-ui/core/ListItem/ListItem";
8 import { ReactElement } from "react";
10 interface TreeProps<T> {
12 render: (item: T) => ReactElement<{}>
15 class Tree<T> extends React.Component<TreeProps<T>, {}> {
18 {this.props.items && this.props.items.map((it: T, idx: number) =>
19 <ListItem key={`item/${idx}`} button>
20 {this.props.render(it)}