chore: update ProductionCapacity component for improved readability and maintainability

This commit is contained in:
Gomathi 2025-05-23 12:12:23 +05:30
parent 0cfd9307d0
commit b6597a912a
1 changed files with 66 additions and 63 deletions

View File

@ -31,6 +31,7 @@ interface ProductionCapacityProps {
type: string; type: string;
position: [number, number, number]; position: [number, number, number];
rotation: [number, number, number]; rotation: [number, number, number];
scale?: [number, number, number];
Data?: any; Data?: any;
onContextMenu?: (event: React.MouseEvent) => void; onContextMenu?: (event: React.MouseEvent) => void;
// onPointerDown:any // onPointerDown:any
@ -41,7 +42,8 @@ const ProductionCapacity: React.FC<ProductionCapacityProps> = ({
type, type,
Data, Data,
position, position,
rotation, rotation = [0, 0, 0],
scale = [0.5, 0.5, 0.5],
onContextMenu, onContextMenu,
}) => { }) => {
const { selectedChartId, setSelectedChartId } = useWidgetStore(); const { selectedChartId, setSelectedChartId } = useWidgetStore();
@ -198,11 +200,11 @@ const ProductionCapacity: React.FC<ProductionCapacityProps> = ({
useEffect(() => { }, [rotation]); useEffect(() => { }, [rotation]);
return ( return (
<>
<Html {position && scale && rotation && <Html
// data // data
position={position} position={position}
scale={[0.5, 0.5, 0.5]} scale={scale}
rotation={rotation} rotation={rotation}
// class // class
wrapperClass="pointer-none" wrapperClass="pointer-none"
@ -265,7 +267,8 @@ const ProductionCapacity: React.FC<ProductionCapacityProps> = ({
/> />
</div> </div>
</div> </div>
</Html> </Html>}
</>
); );
}; };