Files
drawdb/src/components/SortableList/DragHandle.jsx
2025-11-02 20:34:07 +04:00

16 lines
384 B
JavaScript

import { IconHandle } from "@douyinfe/semi-icons";
import { useSortable } from "@dnd-kit/sortable";
export function DragHandle({ id, readOnly }) {
const { listeners } = useSortable({ id });
return (
<div
className={`opacity-50 mt-1.5 ${readOnly ? "cursor-not-allowed" : "cursor-move"}`}
{...(!readOnly && listeners)}
>
<IconHandle />
</div>
);
}