fix(segmentation): Display "No description S:{series number} {modality}" for segmentations with no label. (#5874)
* Bump CS3D dependency to get the fallbackLabel field additions.
This commit is contained in:
1 parent
15f14e34e4
commit
7b5d0ce40e
23 files changed
+349
-228
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Segmentation } from './contexts/SegmentationTableContext';
|
||||
|
||||
/**
|
||||
* Displays the segmentation label. When the label is blank, shows a translated
|
||||
* "No description" with the series/modality suffix styled in a lighter, muted font.
|
||||
*/
|
||||
export const SegmentationLabel = ({ segmentation }: { segmentation: Segmentation }) => {
|
||||
const { t } = useTranslation('SegmentationPanel');
|
||||
|
||||
if (!segmentation) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (segmentation.label) {
|
||||
return <>{segmentation.label}</>;
|
||||
}
|
||||
|
||||
const suffix = segmentation.fallbackLabel;
|
||||
return (
|
||||
<>
|
||||
<span>{t('No description')}</span>
|
||||
{suffix && <span className="text-muted-foreground text-xxs"> {suffix}</span>}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user