floating widgets data added

This commit is contained in:
2025-03-27 18:04:16 +05:30
parent dac7edb837
commit 2591de38da
14 changed files with 431 additions and 175 deletions

View File

@@ -1,5 +1,6 @@
import React, { useEffect, useRef } from "react";
import { Widget } from "../../../store/useWidgetStore";
import { useDroppedObjectsStore } from "../../../store/useDroppedObjectsStore";
// Define the type for `Side`
type Side = "top" | "bottom" | "left" | "right";
@@ -64,9 +65,9 @@ const DisplayZone: React.FC<DisplayZoneProps> = ({
const [selectedOption, setSelectedOption] = React.useState<string | null>(
null
);
// console.log('setSelectedOption: ', setSelectedOption);
//
const [options, setOptions] = React.useState<string[]>([]);
// console.log('setOptions: ', setOptions);
//
// Scroll to the selected option when it changes
useEffect(() => {
@@ -170,8 +171,7 @@ const DisplayZone: React.FC<DisplayZoneProps> = ({
className={`zone ${selectedZone.zoneName === zoneName ? "active" : ""
}`}
onClick={() => {
useDroppedObjectsStore.getState().setZone(zoneName, zonesData[zoneName]?.zoneId);
setSelectedZone({
zoneName,
activeSides: zonesData[zoneName].activeSides || [],