2 * Holds the buttons for save/reset for forms.
3 * Used by the ValidationForm that changes the state of the buttons according to its own state.
6 * labledButtons - whether or not to use labeled buttons or icons only
8 import React from 'react';
9 import i18n from 'nfvo-utils/i18n/i18n.js';
10 import Button from 'react-bootstrap/lib/Button.js';
11 import FontAwesome from 'react-fontawesome';
13 class ValidationButtons extends React.Component {
16 labledButtons: React.PropTypes.bool.isRequired,
17 isReadOnlyMode: React.PropTypes.bool
21 isValid: this.props.formValid
25 var submitBtn = this.props.labledButtons ? i18n('Save') : <FontAwesome className='check' name='check'/>;
26 var closeBtn = this.props.labledButtons ? i18n('Cancel') : <FontAwesome className='close' name='close'/>;
28 <div className='validation-buttons'>
29 {!this.props.isReadOnlyMode ?
31 <Button bsStyle='primary' ref='submitbutton' type='submit' disabled={!this.state.isValid}>{submitBtn}</Button>
32 <Button type='reset'>{closeBtn}</Button>
34 : <Button type='reset'>{i18n('Close')}</Button>
40 export default ValidationButtons;