forked from PlanQK/workflow-modeler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ButtonToolbar.js
46 lines (43 loc) · 1.47 KB
/
ButtonToolbar.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React, { Fragment } from "react";
import SaveButton from "./SaveButton";
import OpenButton from "./OpenButton";
import NewDiagramButton from "./NewDiagramButton";
import DeploymentButton from "./DeploymentButton";
import TransformationToolbarButton from "./TransformationToolbarButton";
import UploadButton from "./UploadButton";
import XMLViewerButton from "./XMLViewerButton";
import SaveAsButton from "./SaveAsButton";
/**
* React component which displays the toolbar of the modeler
*
* @param props Properties of the toolbar
* @returns {JSX.Element} The React component
* @constructor
*/
export default function ButtonToolbar(props) {
const { modeler, pluginButtons, transformButtons } = props;
const hasTransformations = transformButtons.length > 0;
return (
<Fragment>
<div className="qwm-toolbar">
<NewDiagramButton modeler={modeler} />
<OpenButton />
<SaveButton modeler={modeler} />
<SaveAsButton modeler={modeler} />
<UploadButton />
<XMLViewerButton />
<hr className="qwm-toolbar-splitter" />
{hasTransformations && (
<TransformationToolbarButton
subButtons={transformButtons}
title="Transformation"
styleClass="qwm-workflow-transformation-btn"
/>
)}
<DeploymentButton modeler={modeler} />
<hr className="qwm-toolbar-splitter" />
{React.Children.toArray(pluginButtons)}
</div>
</Fragment>
);
}