import * as React from "react"; import { FocusZone } from "office-ui-fabric-react/lib/FocusZone"; import { AccessibleElement } from "../../Controls/AccessibleElement/AccessibleElement"; export interface CaptionId { caption: string; id: string; } interface LeftPaneComponentProps { isFilterGraphEmptyResult: boolean; possibleRootNodes: CaptionId[]; onRootNodeSelected: (id: string) => void; selectedRootId: string; isUiBusy: boolean; onLoadNextPage: () => void; hasMoreRoots: boolean; } export class LeftPaneComponent extends React.Component { public render(): JSX.Element { return (
Results
{this.props.isFilterGraphEmptyResult &&
None
} {this.props.possibleRootNodes.map((rootNode: CaptionId) => this.renderRootNodeRow(rootNode))}
{this.props.hasMoreRoots && ( Load more )}
); } private renderRootNodeRow(node: CaptionId): JSX.Element { let className = "pointer"; if (this.props.selectedRootId === node.id) { className += " gridRowSelected"; } if (this.props.isUiBusy) { className += " disabled"; } return ( this.props.onRootNodeSelected(node.id)} key={node.id} > {node.caption} ); } }