Skip to content

Commit 122946e

Browse files
feat(ui): DndDropOverlay supports react node for label
1 parent 2d974f6 commit 122946e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

invokeai/frontend/web/src/features/dnd/DndDropOverlay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { SystemStyleObject } from '@invoke-ai/ui-library';
22
import { Flex, Text } from '@invoke-ai/ui-library';
33
import type { DndTargetState } from 'features/dnd/types';
4+
import { isNil, isString } from 'lodash-es';
5+
import type { ReactNode } from 'react';
46
import { memo } from 'react';
57

68
type Props = {
79
dndState: DndTargetState;
8-
label?: string;
10+
label?: string | ReactNode;
911
withBackdrop?: boolean;
1012
};
1113

@@ -74,7 +76,8 @@ export const DndDropOverlay = memo((props: Props) => {
7476
<Flex className="dnd-drop-overlay" data-dnd-state={dndState} sx={sx}>
7577
{withBackdrop && <Flex className="dnd-drop-overlay-backdrop" />}
7678
<Flex className="dnd-drop-overlay-content">
77-
{label && <Text className="dnd-drop-overlay-label">{label}</Text>}
79+
{isString(label) && <Text className="dnd-drop-overlay-label">{label}</Text>}
80+
{!isNil(label) && !isString(label) && label}
7881
</Flex>
7982
</Flex>
8083
);

0 commit comments

Comments
 (0)