2024-04-17 12:50:02 +00:00
|
|
|
import { forwardRef } from "react";
|
2023-11-18 20:16:11 +00:00
|
|
|
import { MoreVertical } from "lucide-react";
|
|
|
|
|
|
|
|
interface IDragHandle {
|
|
|
|
isDragging: boolean;
|
|
|
|
}
|
|
|
|
|
2024-04-17 12:50:02 +00:00
|
|
|
export const DragHandle = forwardRef<HTMLButtonElement | null, IDragHandle>((props, ref) => {
|
|
|
|
const { isDragging } = props;
|
2023-11-18 20:16:11 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
type="button"
|
2024-04-17 12:50:02 +00:00
|
|
|
className={`mr-1 flex flex-shrink-0 rounded text-custom-sidebar-text-200 group-hover:opacity-100 cursor-grab ${
|
2023-11-18 20:16:11 +00:00
|
|
|
isDragging ? "opacity-100" : "opacity-0"
|
|
|
|
}`}
|
2024-04-17 12:50:02 +00:00
|
|
|
ref={ref}
|
2023-11-18 20:16:11 +00:00
|
|
|
>
|
|
|
|
<MoreVertical className="h-3.5 w-3.5 stroke-custom-text-400" />
|
2023-12-10 10:18:10 +00:00
|
|
|
<MoreVertical className="-ml-5 h-3.5 w-3.5 stroke-custom-text-400" />
|
2023-11-18 20:16:11 +00:00
|
|
|
</button>
|
|
|
|
);
|
2024-04-17 12:50:02 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
DragHandle.displayName = "DragHandle";
|