mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-01-13 07:02:37 +08:00
16 lines
384 B
JavaScript
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>
|
|
);
|
|
}
|