2019-08-13 15:36:46 -04:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
|
|
|
|
|
|
import { Icon } from './../../elements/Icon';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
2019-10-28 14:47:57 -04:00
|
|
|
class PageToolbar extends PureComponent {
|
2019-08-13 15:36:46 -04:00
|
|
|
static propTypes = {
|
|
|
|
|
onImport: PropTypes.func,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onImport = event => {
|
|
|
|
|
if (this.props.onImport) {
|
|
|
|
|
this.props.onImport(event);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getImportTool() {
|
|
|
|
|
if (this.props.onImport) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="addNewStudy btn-file">
|
|
|
|
|
<label
|
|
|
|
|
htmlFor="btnImport"
|
|
|
|
|
style={{ width: '18px' }}
|
|
|
|
|
onClick={this.onImport}
|
|
|
|
|
>
|
|
|
|
|
<Icon name="plus" />
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return <div className="studylistToolbar">{this.getImportTool()}</div>;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-28 14:47:57 -04:00
|
|
|
export { PageToolbar };
|