/** * React component for control bar */ import * as React from "react"; import { CommandButtonComponent, CommandButtonComponentProps, } from "../../Controls/CommandButton/CommandButtonComponent"; export interface ControlBarComponentProps { buttons: CommandButtonComponentProps[]; } export class ControlBarComponent extends React.Component { private static renderButtons(commandButtonOptions: CommandButtonComponentProps[]): JSX.Element[] { return commandButtonOptions.map((btn: CommandButtonComponentProps, index: number): JSX.Element => { // Remove label btn.commandButtonLabel = undefined; return CommandButtonComponent.renderButton(btn, `${index}`); }); } public render(): JSX.Element { if (!this.props.buttons || this.props.buttons.length < 1) { return ; } return {ControlBarComponent.renderButtons(this.props.buttons)}; } }