static-cms/src/components/EntryEditor/EntryEditorToolbar.js

36 lines
703 B
JavaScript

import React, { PropTypes } from 'react';
import { Button } from 'react-toolbox/lib/button';
const EntryEditorToolbar = (
{
isPersisting,
onPersist,
onCancelEdit,
}) => {
const disabled = isPersisting;
return (
<div>
<Button
primary
raised
onClick={onPersist}
disabled={disabled}
>
{ isPersisting ? 'Saving...' : 'Save' }
</Button>
{' '}
<Button onClick={onCancelEdit}>
Cancel
</Button>
</div>
);
};
EntryEditorToolbar.propTypes = {
isPersisting: PropTypes.bool,
onPersist: PropTypes.func.isRequired,
onCancelEdit: PropTypes.func.isRequired,
};
export default EntryEditorToolbar;