import { useSortable } from '@dnd-kit/sortable' import { GripVertical } from 'lucide-react' import type { CSSProperties, PropsWithChildren } from 'react' import { cn } from 'ui' export const SortableSection = ({ id, children, gripClassName, }: PropsWithChildren<{ id: string; gripClassName?: string }>) => { const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id, }) const style: CSSProperties = { transform: transform ? `translate3d(${Math.round(transform.x)}px, ${Math.round(transform.y)}px, 0)` : undefined, transition, } return (
{children}
) }