import React from 'react'; import { Numeric } from '@ohif/ui-next'; import { useViewportDisplaySets, useViewportRendering } from '../../hooks'; interface OpacityMenuProps { viewportId: string; className?: string; } function OpacityMenu({ viewportId, className }: OpacityMenuProps) { const { backgroundDisplaySet, foregroundDisplaySets } = useViewportDisplaySets(viewportId, { includeForeground: true, includeBackground: true, }); const { opacityLinear, setOpacityLinear } = useViewportRendering(viewportId, { displaySetInstanceUID: foregroundDisplaySets[0].displaySetInstanceUID, }); const opacityValue = opacityLinear !== undefined ? opacityLinear : 0; const backgroundModality = backgroundDisplaySet?.Modality || ''; const foregroundModality = foregroundDisplaySets[0]?.Modality || ''; return (