refactor: Remove Html wrapper and integrate AssetDetailsCard into new RoboticArmContentUi and VehicleContentUi components
This commit is contained in:
34
app/src/modules/simulation/ui3d/RoboticArmContentUi.tsx
Normal file
34
app/src/modules/simulation/ui3d/RoboticArmContentUi.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Html } from "@react-three/drei";
|
||||
import React from "react";
|
||||
import AssetDetailsCard from "../../../components/ui/simulation/AssetDetailsCard";
|
||||
import { Vector3 } from "three";
|
||||
|
||||
type VehicleContentUiProps = {
|
||||
roboticArm: ArmBotStatus;
|
||||
};
|
||||
|
||||
const RoboticArmContentUi: React.FC<VehicleContentUiProps> = ({ roboticArm }) => {
|
||||
return (
|
||||
<Html
|
||||
// data
|
||||
position={
|
||||
new Vector3(
|
||||
roboticArm.position[0],
|
||||
roboticArm.point.position[1],
|
||||
roboticArm.position[2]
|
||||
)
|
||||
}
|
||||
// class none
|
||||
// other
|
||||
zIndexRange={[1, 0]}
|
||||
prepend
|
||||
sprite
|
||||
center
|
||||
distanceFactor={20}
|
||||
>
|
||||
<AssetDetailsCard name={roboticArm.modelName} status={roboticArm.state} />
|
||||
</Html>
|
||||
);
|
||||
};
|
||||
|
||||
export default RoboticArmContentUi;
|
||||
Reference in New Issue
Block a user