Files
workavia-drive/tdrive/frontend/src/app/features/dragndrop/hook/draggable.tsx
T
Eric Doughty-Papassideris 26ca1be629 🚨⚰️ front: Remove unused references
2024-11-13 11:27:31 +01:00

22 lines
449 B
TypeScript

import React from 'react';
import {useDraggable} from '@dnd-kit/core';
type DraggableProps={
children: React.ReactNode
id: number
}
export function Draggable(props:DraggableProps) {
const { attributes, listeners, setNodeRef } = useDraggable({
id: `draggable-${props.id+1}`,
data: {
child: props.children
},
});
return (
<div ref={setNodeRef} {...listeners} {...attributes}>
{props.children}
</div>
);
}