import './ToolbarRow.css';
import React, { Component } from 'react';
import ConnectedLayoutButton from './ConnectedLayoutButton';
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
import { MODULE_TYPES } from 'ohif-core';
import PropTypes from 'prop-types';
import { RoundedButtonGroup } from 'react-viewerbase';
class ToolbarRow extends Component {
static propTypes = {
leftSidebarOpen: PropTypes.bool.isRequired,
rightSidebarOpen: PropTypes.bool.isRequired,
setLeftSidebarOpen: PropTypes.func,
setRightSidebarOpen: PropTypes.func,
pluginId: PropTypes.string,
};
static defaultProps = {
leftSidebarOpen: false,
rightSidebarOpen: false,
};
onLeftSidebarValueChanged = value => {
this.props.setLeftSidebarOpen(!!value);
};
onRightSidebarValueChanged = value => {
this.props.setRightSidebarOpen(!!value);
};
render() {
const leftSidebarToggle = [
{
value: 'studies',
icon: 'th-large',
bottomLabel: 'Series',
},
];
const rightSidebarToggle = [
{
value: 'measurements',
icon: 'list',
bottomLabel: 'Measurements',
},
];
const leftSidebarValue = this.props.leftSidebarOpen
? leftSidebarToggle[0].value
: null;
const rightSidebarValue = this.props.rightSidebarOpen
? rightSidebarToggle[0].value
: null;
const currentPluginId = this.props.pluginId;
const plugin = availablePlugins.find(entry => {
return (
entry.type === MODULE_TYPES.TOOLBAR && entry.id === currentPluginId
);
});
let pluginComp;
if (plugin) {
const PluginComponent = plugin.component;
pluginComp =