refactor: Clean up unused imports and improve code structure in 3D widget components
This commit is contained in:
@@ -206,13 +206,13 @@ export default function Dropped3dWidgets() {
|
||||
y = Math.max(y, 0);
|
||||
newWidget.position = [x, y, z];
|
||||
|
||||
// ✅ Prepare polygon from selectedZone.points
|
||||
const points3D = selectedZone.points as Array<[number, number, number]>;
|
||||
const zonePolygonXZ = points3D.map(
|
||||
([x, , z]) => [x, z] as [number, number]
|
||||
);
|
||||
// // ✅ Prepare polygon from selectedZone.points
|
||||
// const points3D = selectedZone.points as Array<[number, number, number]>;
|
||||
// const zonePolygonXZ = points3D.map(
|
||||
// ([x, , z]) => [x, z] as [number, number]
|
||||
// );
|
||||
|
||||
const isInside = isPointInPolygon([x, z], zonePolygonXZ);
|
||||
// const isInside = isPointInPolygon([x, z], zonePolygonXZ);
|
||||
|
||||
// ✅ Remove temp widget
|
||||
const prevWidgets =
|
||||
|
||||
@@ -210,10 +210,11 @@ const ReturnOfInvestment: React.FC<ReturnOfInvestmentProps> = ({
|
||||
if (response.message === "Widget not found") {
|
||||
return
|
||||
}
|
||||
|
||||
if (response) {
|
||||
setmeasurements(response.data.Data.measurements);
|
||||
setDuration(response.data.Data.duration);
|
||||
setName(response.data.widgetName);
|
||||
setmeasurements(response.Datastructure.measurements);
|
||||
setDuration(response.Datastructure.duration);
|
||||
setName(response.widgetName);
|
||||
}
|
||||
// try {
|
||||
// const response = await axios.get(
|
||||
|
||||
Reference in New Issue
Block a user