@@ -384,36 +384,48 @@ const PlateCanvas = forwardRef<HTMLDivElement, PlateCanvasProps>(
384384 } ) }
385385 </ div >
386386 { /* Plate dimensions label */ }
387- < div className = "text-xs text-gray-400" >
388- Rückwand { plates . findIndex ( ( p ) => p . id === plate . id ) + 1 } :{ " " }
389- { plate . width . toFixed ( 1 ) } x { plate . height . toFixed ( 1 ) } cm
390- </ div >
387+ { /* When selectedPlate is set, show "Rückwand" prefix only for selected plate */ }
388+ { /* When selectedPlate is empty, show all plates without "Rückwand" prefix */ }
389+ { ( ! selectedPlate || selectedPlate === plate . id ) && (
390+ < div className = "text-xs text-gray-400" >
391+ { selectedPlate === plate . id ? "Rückwand " : "" }
392+ { plates . findIndex ( ( p ) => p . id === plate . id ) + 1 } :{ " " }
393+ { plate . width . toFixed ( 1 ) } x { plate . height . toFixed ( 1 ) } cm
394+ </ div >
395+ ) }
391396 { /* Socket group positions - only show when single plate is selected */ }
392397 { isSinglePlate && plateSocketGroups . length > 0 && (
393- < div className = "mt-2 max-h-32 overflow-y-auto space-y-1" >
394- { plateSocketGroups . map ( ( sg , idx ) => {
395- const isDragging = dragState ?. socketGroupId === sg . id ;
396- // Use live drag values if dragging, otherwise use stored position values
397- const positionX =
398- isDragging && dragState ?. liveDistanceX !== undefined
399- ? dragState . liveDistanceX
400- : sg . positionX ;
401- const positionY =
402- isDragging && dragState ?. liveDistanceY !== undefined
403- ? dragState . liveDistanceY
404- : sg . positionY ;
405- return (
406- < div
407- key = { sg . id }
408- className = { `text-[10px] sm:text-xs text-gray-400 ${
409- isDragging ? "text-green-400 font-semibold" : ""
410- } `}
411- >
412- Steckdosengr. { idx + 1 } : X: { positionX . toFixed ( 1 ) } { " " }
413- cm | Y: { positionY . toFixed ( 1 ) } cm
414- </ div >
415- ) ;
416- } ) }
398+ < div className = "mt-2" >
399+ { /* Title for socket groups */ }
400+ < div className = "text-[10px] sm:text-xs text-gray-400 font-medium text-center mb-1" >
401+ Steckdosengr.
402+ </ div >
403+ { /* List of socket group positions */ }
404+ < div className = "max-h-32 overflow-y-auto space-y-1 text-center" >
405+ { plateSocketGroups . map ( ( sg , idx ) => {
406+ const isDragging = dragState ?. socketGroupId === sg . id ;
407+ // Use live drag values if dragging, otherwise use stored position values
408+ const positionX =
409+ isDragging && dragState ?. liveDistanceX !== undefined
410+ ? dragState . liveDistanceX
411+ : sg . positionX ;
412+ const positionY =
413+ isDragging && dragState ?. liveDistanceY !== undefined
414+ ? dragState . liveDistanceY
415+ : sg . positionY ;
416+ return (
417+ < div
418+ key = { sg . id }
419+ className = { `text-[10px] sm:text-xs text-gray-400 ${
420+ isDragging ? "text-green-400 font-semibold" : ""
421+ } `}
422+ >
423+ { idx + 1 } : X: { positionX . toFixed ( 1 ) } cm | Y:{ " " }
424+ { positionY . toFixed ( 1 ) } cm
425+ </ div >
426+ ) ;
427+ } ) }
428+ </ div >
417429 </ div >
418430 ) }
419431 </ div >
0 commit comments