1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/core/__mocks__/react-beautiful-dnd.tsx
Sebastian Malton 3a62cd4848 chore: Fix new build errors in @k8slens/core
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:17:41 -04:00

60 lines
1.4 KiB
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import React from "react";
import type {
DragDropContextProps,
DraggableProps,
DraggableProvided,
DraggableProvidedDraggableProps,
DraggableStateSnapshot,
DroppableProps,
DroppableProvided,
DroppableProvidedProps,
DroppableStateSnapshot,
} from "react-beautiful-dnd";
export const DragDropContext = ({ children }: DragDropContextProps) => <>{ children }</>;
export const Draggable = ({ children }: DraggableProps) => (
<>
{
children(
{
draggableProps: {} as DraggableProvidedDraggableProps,
innerRef: () => {},
} as unknown as DraggableProvided,
{
isDragging: false,
isDropAnimating: false,
} as DraggableStateSnapshot,
{
draggableId: "some-mock-draggable-id",
type: "FLUID",
source: {
droppableId: "some-mock-droppable-id",
index: 0,
},
},
)
}
</>
);
export const Droppable = ({ children }: DroppableProps) => (
<>
{
children(
{
droppableProps: {} as DroppableProvidedProps,
innerRef: () => {},
} as unknown as DroppableProvided,
{
isDraggingOver: false,
isUsingPlaceholder: false,
} as DroppableStateSnapshot,
)
}
</>
);