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