import React from 'react'; import { Select, Icon, Dropdown } from '../../components'; import PropTypes from 'prop-types'; function SegmentationDropDownRow({ segmentations = [], activeSegmentation, onActiveSegmentationChange, disableEditing, onToggleSegmentationVisibility, onSegmentationEdit, onSegmentationDownload, onSegmentationDownloadRTSS, storeSegmentation, onSegmentationDelete, onSegmentationAdd, }) { const handleChange = option => { onActiveSegmentationChange(option.value); // Notify the parent }; const selectOptions = segmentations.map(s => ({ value: s.id, label: s.label, })); if (!activeSegmentation) { return null; } return (
{ e.stopPropagation(); }} > { onSegmentationAdd(); }, }, ] : []), ...(!disableEditing ? [ { title: 'Rename', onClick: () => { onSegmentationEdit(activeSegmentation.id); }, }, ] : []), { title: 'Delete', onClick: () => { onSegmentationDelete(activeSegmentation.id); }, }, ...(!disableEditing ? [ { title: 'Export DICOM SEG', onClick: () => { storeSegmentation(activeSegmentation.id); }, }, ] : []), ...[ { title: 'Download DICOM SEG', onClick: () => { onSegmentationDownload(activeSegmentation.id); }, }, { title: 'Download DICOM RTSTRUCT', onClick: () => { onSegmentationDownloadRTSS(activeSegmentation.id); }, }, ], ]} >
{selectOptions?.length && (