From c227c5742a81808afabe79407c84429f8b60496c Mon Sep 17 00:00:00 2001 From: Dan Rukas Date: Mon, 17 Mar 2025 22:57:19 -0400 Subject: [PATCH] ui(panels): PetSUV updates for ui-next and responsive layout (#4864) --- extensions/tmtv/src/Panels/PanelPetSUV.tsx | 214 ++++++++++++--------- 1 file changed, 120 insertions(+), 94 deletions(-) diff --git a/extensions/tmtv/src/Panels/PanelPetSUV.tsx b/extensions/tmtv/src/Panels/PanelPetSUV.tsx index 259a4c7fe..21814cff4 100644 --- a/extensions/tmtv/src/Panels/PanelPetSUV.tsx +++ b/extensions/tmtv/src/Panels/PanelPetSUV.tsx @@ -1,9 +1,8 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; -import { PanelSection, Input, Button } from '@ohif/ui'; import { DicomMetadataStore } from '@ohif/core'; import { useTranslation } from 'react-i18next'; -import { Separator } from '@ohif/ui-next'; +import { Button, Input, Label, PanelSection, Separator } from '@ohif/ui-next'; const DEFAULT_MEATADATA = { PatientWeight: null, @@ -23,6 +22,38 @@ const DEFAULT_MEATADATA = { * @param param0 * @returns */ + +// InputRow compound component +const InputRow = ({ children, className, ...props }) => { + return ( +
+ {children} +
+ ); +}; + +// InputRow sub-components +InputRow.Label = ({ children, unit, className, ...props }) => ( + +); + +InputRow.Input = ({ className, ...props }) => ( + +); + +// Set display names for better debugging +InputRow.Label.displayName = 'InputRow.Label'; +InputRow.Input.displayName = 'InputRow.Input'; + export default function PanelPetSUV({ servicesManager, commandsManager }: withAppTypes) { const { t } = useTranslation('PanelSUV'); const { displaySetService, toolGroupService, toolbarService, hangingProtocolService } = @@ -128,103 +159,98 @@ export default function PanelPetSUV({ servicesManager, commandsManager }: withAp return ( <>
-
- -
-
- { - handleMetadataChange({ - PatientSex: e.target.value, - }); - }} - /> - kg} - labelClassName="text-[13px] font-inter text-white" - className="!m-0 !h-[26px] !w-[117px]" - value={metadata.PatientWeight || ''} - onChange={e => { - handleMetadataChange({ - PatientWeight: e.target.value, - }); - }} - id="weight-input" - /> - bq} - labelClassName="text-[13px] font-inter text-white" - className="!m-0 !h-[26px] !w-[117px]" - value={ - metadata.RadiopharmaceuticalInformationSequence.RadionuclideTotalDose || '' - } - onChange={e => { - handleMetadataChange({ - RadiopharmaceuticalInformationSequence: { - RadionuclideTotalDose: e.target.value, - }, - }); - }} - /> - s} - labelClassName="text-[13px] font-inter text-white" - className="!m-0 !h-[26px] !w-[117px]" - value={metadata.RadiopharmaceuticalInformationSequence.RadionuclideHalfLife || ''} - onChange={e => { - handleMetadataChange({ - RadiopharmaceuticalInformationSequence: { - RadionuclideHalfLife: e.target.value, - }, - }); - }} - /> - s} - labelClassName="text-[13px] font-inter text-white" - className="!m-0 !h-[26px] !w-[117px]" - value={ - metadata.RadiopharmaceuticalInformationSequence.RadiopharmaceuticalStartTime || - '' - } - onChange={e => { - handleMetadataChange({ - RadiopharmaceuticalInformationSequence: { - RadiopharmaceuticalStartTime: e.target.value, - }, - }); - }} - /> - s} - labelClassName="text-[13px] font-inter text-white" - className="!m-0 !h-[26px] !w-[117px]" - value={metadata.SeriesTime || ''} - onChange={() => {}} - /> +
+ + {t('Patient Information')} + +
+ + {t('Patient Sex')} + { + handleMetadataChange({ + PatientSex: e.target.value, + }); + }} + /> + + + + {t('Weight')} + { + handleMetadataChange({ + PatientWeight: e.target.value, + }); + }} + id="weight-input" + /> + + + + {t('Total Dose')} + { + handleMetadataChange({ + RadiopharmaceuticalInformationSequence: { + RadionuclideTotalDose: e.target.value, + }, + }); + }} + /> + + + + {t('Half Life')} + { + handleMetadataChange({ + RadiopharmaceuticalInformationSequence: { + RadionuclideHalfLife: e.target.value, + }, + }); + }} + /> + + + + {t('Injection Time')} + { + handleMetadataChange({ + RadiopharmaceuticalInformationSequence: { + RadiopharmaceuticalStartTime: e.target.value, + }, + }); + }} + /> + + + + {t('Acquisition Time')} + {}} + /> + +
-
+
@@ -243,4 +269,4 @@ PanelPetSUV.propTypes = { }).isRequired, }).isRequired, }).isRequired, -}; +}; \ No newline at end of file