import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import { TableListItem, Icon, Tooltip, OverlayTrigger } from '@ohif/ui'; import ReactTooltip from 'react-tooltip'; import './StructureSetItem.css'; const ColoredCircle = ({ color }) => { return (
); }; ColoredCircle.propTypes = { color: PropTypes.array.isRequired, }; const StructureSetItem = ({ index, label, isDisabled, onClick, itemClass, color, visible = true, onVisibilityChange, selected = false, }) => { const [isVisible, setIsVisible] = useState(visible); useEffect(() => { setIsVisible(visible); }, [visible]); let dcmrtClassNames = `dcmrt-structure-set-item`; if (selected) { dcmrtClassNames += ' selected'; } if (isDisabled) { dcmrtClassNames += ' isDisabled'; } const warningIcon = ( ); const tableListItem = ( } itemMetaClass="item-color-section" onItemClick={() => { if (isDisabled) { return; } onClick(); }} >
{label} {label} {!isDisabled && ( { event.stopPropagation(); if (isDisabled) { return; } const newVisibility = !isVisible; setIsVisible(newVisibility); onVisibilityChange(newVisibility); }} /> )}
{false &&
{'...'}
} {false && (
)}
); return (
{isDisabled ? (
Unsupported Region
Contour type currently unsupported.
} >
{tableListItem}
) : ( {tableListItem} )}
); }; StructureSetItem.propTypes = { index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, label: PropTypes.string.isRequired, onClick: PropTypes.func, itemClass: PropTypes.string, color: PropTypes.array.isRequired, }; StructureSetItem.defaultProps = { itemClass: '', onClick: () => {}, }; export default StructureSetItem;