Use Client Import React
Use Client Import React
Use Client Import React
setBackgroundSizeX(newBackgroundSizeX)
setBackgroundSizeY(newBackgroundSizeY)
setBackgroundSizeX(newBackgroundSizeX)
setBackgroundSizeY(newBackgroundSizeY)
return (
<div>
<div
ref={drop}
className="h-[calc(100vh-4rem)] w-[100vw] -z-1"
style={{
backgroundImage: ' radial-gradient(#b9b9b9 1px, transparent 0)',
backgroundSize: '20px 20px',
}}
>
<Drag
setShowBackgroundImage={setShowBackgroundImage}
handleZoomIn={handleZoomIn}
handleZoomOut={handleZoomOut}
handleFitContent={handleFitContent}
/>
{droppedItems.map((droppedItem, index) => {
console.log(droppedItem.subTab.icon)
const Icon = droppedItem.subTab.icon
return (
<Draggable
key={index}
defaultPosition={{
x: droppedItem.position.x,
y: droppedItem.position.y,
}}
onStop={(e, data) => {
// Handle dragging logic if needed
}}
>
<ResizableBox
width={70}
height={70}
minConstraints={[50, 50]}
maxConstraints={[150, 150]}
onResize={(e, data) => {
// Handle resizing logic if needed
}}
lockAspectRatio={true}
style={{
position: 'absolute',
border: '1px solid #ccc',
padding: '10px',
borderRadius: '5px',
backgroundColor: '#fff',
boxShadow: '0 0 5px rgba(0, 0, 0, 0.2)',
}}
>
<div className="flex w-full justify-center items-center">
<IoCalculatorOutline className="w-full h-full" />
</div>
{/* Render the subList items */}
</ResizableBox>
</Draggable>
)
})}
</div>
</div>
)
}