+
+ {(currentItemIndex === null ? defaultOrders : draggingOrders).map((item: OrderItem, index) => (
+ ) => onMouseDown(event, index)}
+ onTouchStart={(event: React.TouchEvent) => onMouseDown(event, index)}
+ onMouseUp={onDragEnd}
+ onTouchEnd={onDragEnd}
+ onDragStart={onDragStart}
+ onDragOver={isTranslating ? null : (event: React.DragEvent) => onDragOver(event, index)}
+ onDragEnd={onDragEnd}
+ onTransitionEnd={onTransitionEnd}
+ >
+ {React.Children.map(props.children, (Child: React.ReactElement) => {
+ const { uniqueKey }: SortableItemProps = Child.props;
+ const isDisabled: boolean = disabled || item.disabled;
+ return item.uniqueKey === uniqueKey && React.isValidElement>(Child)
+ ? React.cloneElement(Child, {
+ disabled: isDisabled,
+ "aria-disabled": isDisabled,
+ })
+ : null;
+ })}
+
+ ))}
+
+
+ );
+};
+
+type SortableItemWrapperProps = SortableItemProps &
+ JSX.IntrinsicElements["div"] & {
+ isActive?: boolean;
+ disabled?: boolean;
+ isDragging?: boolean;
+ };
+
+const SortableItemWrapper: React.FC