2
0
Files
bot/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNodeOverlay.tsx

27 lines
613 B
TypeScript
Raw Normal View History

import { Flex, FlexProps, useColorModeValue } from '@chakra-ui/react'
import { Item } from 'models'
2022-05-13 09:18:25 -07:00
import React, { ReactNode } from 'react'
2022-01-12 09:10:59 +01:00
type Props = {
item: Item
2022-01-12 09:10:59 +01:00
} & FlexProps
export const ItemNodeOverlay = ({ item, ...props }: Props) => {
2022-01-12 09:10:59 +01:00
return (
<Flex
px="4"
py="2"
rounded="md"
bgColor={useColorModeValue('white', 'gray.850')}
2022-01-19 09:44:21 +01:00
borderWidth="1px"
borderColor={useColorModeValue('gray.200', 'gray.700')}
2022-01-12 09:10:59 +01:00
w="212px"
pointerEvents="none"
2022-01-19 09:44:21 +01:00
shadow="lg"
2022-01-12 09:10:59 +01:00
{...props}
>
2022-05-13 09:18:25 -07:00
{(item.content ?? 'Click to edit') as ReactNode}
2022-01-12 09:10:59 +01:00
</Flex>
)
}