import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { TableListItem, Icon } from '@ohif/ui'; import './StructureSetItem.css'; const ColoredCircle = ({ color }) => { return (
); }; ColoredCircle.propTypes = { color: PropTypes.array.isRequired, }; const StructureSetItem = ({ index, label, onClick, itemClass, color, visible = true, onVisibilityChange, selected = false, }) => { const [isVisible, setIsVisible] = useState(visible); return (
} itemMetaClass="item-color-section" onItemClick={onClick} >
{label} { event.stopPropagation(); const newVisibility = !isVisible; setIsVisible(newVisibility); onVisibilityChange(newVisibility); }} />
{false &&
{'...'}
} {false && (
)}
); }; 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;