e2a7dc54b13d63a99bd1336ab13d6b536b2287b4
[sdc/sdc-workflow-designer.git] /
1 /*
2 * Copyright © 2018 European Support Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 import React from 'react';
18 import { I18n } from 'react-redux-i18n';
19 import { Button } from 'sdc-ui/lib/react';
20 import PropTypes from 'prop-types';
21 import SvgButton from 'features/version/versionController/views/SvgButton';
22
23 const ActionButtons = props => {
24     const {
25         onSaveClick,
26         certifyDisabled,
27         onCertifyClick,
28         onUndoClick,
29         saveDisabled
30     } = props;
31
32     return (
33         <div className="save-submit-cancel-container">
34             <div className="action-buttons">
35                 <div className="select-action-buttons">
36                     <div className={'separator vc-separator'} />
37                     <SvgButton
38                         dataTestId="vc-save-btn"
39                         name="version-controller-save"
40                         tooltipText={I18n.t('buttons.saveBtn')}
41                         disabled={saveDisabled}
42                         onClick={onSaveClick}
43                     />
44
45                     <div className={'separator vc-separator'} />
46
47                     <SvgButton
48                         dataTestId="vc-undo-btn"
49                         name="version-controller-undo"
50                         tooltipText={I18n.t('buttons.undoBtn')}
51                         disabled={certifyDisabled}
52                         onClick={onUndoClick}
53                     />
54
55                     <div className={'separator vc-separator'} />
56
57                     <Button
58                         className="certifyBtn"
59                         btnType="primary"
60                         disabled={certifyDisabled}
61                         onClick={onCertifyClick}>
62                         {I18n.t('buttons.certifyBtn')}
63                     </Button>
64                 </div>
65             </div>
66         </div>
67     );
68 };
69
70 ActionButtons.propTypes = {
71     onSaveClick: PropTypes.func,
72     certifyDisabled: PropTypes.bool,
73     onCertifyClick: PropTypes.func,
74     onUndoClick: PropTypes.func,
75     saveDisabled: PropTypes.bool
76 };
77
78 export default ActionButtons;