25 lines
596 B
TypeScript
25 lines
596 B
TypeScript
import type { PropsWithChildren } from "react";
|
|
import {
|
|
defaultDropAnimationSideEffects,
|
|
DragOverlay,
|
|
DropAnimation,
|
|
} from "@dnd-kit/core";
|
|
|
|
const dropAnimationConfig: DropAnimation = {
|
|
sideEffects: defaultDropAnimationSideEffects({
|
|
styles: {
|
|
active: {
|
|
opacity: "0.4",
|
|
},
|
|
},
|
|
}),
|
|
};
|
|
|
|
export function SortableOverlay({ children }: PropsWithChildren) {
|
|
return (
|
|
<DragOverlay dropAnimation={dropAnimationConfig}>
|
|
<div style={{ cursor: "grabbing" }}>{children}</div>
|
|
</DragOverlay>
|
|
);
|
|
}
|