import * as React from 'react' import * as q from '../../../../backend/src/Model' // import Drawer from '@material-ui/core/Drawer' import { Typography } from '@material-ui/core' import { withStyles, Theme, StyleRulesCallback } from '@material-ui/core/styles' interface Props { node: q.TreeNode, classes: any, theme: Theme } interface State { node?: q.TreeNode | undefined } class NodeStats extends React.Component { constructor(props: any) { super(props) } public static styles: StyleRulesCallback = (theme: Theme) => { return { } } public render() { const leafes = this.props.node.leafes() const leafMessages = leafes .map(leaf => leaf.messages) .reduce((a, b) => a + b) return
Messages: #{this.props.node.messages} Subtopics: {leafes.length} Messages Subtopics: #{leafMessages}
} } export default withStyles(NodeStats.styles, { withTheme: true })(NodeStats)