fix: Update ZoneData interface and streamline loader function calls in loadInitialFloorItems
This commit is contained in:
@@ -52,7 +52,7 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
interface ZoneData {
|
||||
id: string;
|
||||
name: string;
|
||||
assets: { id: string; name: string; position?: [] ;rotation?:{}}[];
|
||||
assets: { id: string; name: string; position?: []; rotation?: {} }[];
|
||||
}
|
||||
const [zoneDataList, setZoneDataList] = useState<ZoneData[]>([]);
|
||||
const { floorItems, setFloorItems } = useFloorItems();
|
||||
@@ -70,6 +70,7 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
}
|
||||
return inside;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
const updatedZoneList: ZoneData[] = zones.map((zone: Zone) => {
|
||||
@@ -84,7 +85,7 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
id: item.modeluuid,
|
||||
name: item.modelname,
|
||||
position: item.position,
|
||||
rotation:item.rotation
|
||||
rotation: item.rotation
|
||||
}));
|
||||
|
||||
return {
|
||||
@@ -96,9 +97,6 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
setZoneDataList(updatedZoneList);
|
||||
}, [zones, floorItems]);
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="dropdown-list-container">
|
||||
<div className="head">
|
||||
|
||||
Reference in New Issue
Block a user