({ component })
| 5 | import { Alert, Box } from '@chakra-ui/react' |
| 6 | |
| 7 | const AlertPreview: React.FC<IPreviewProps> = ({ component }) => { |
| 8 | const acceptedTypes = [ |
| 9 | 'AlertIcon', |
| 10 | 'AlertTitle', |
| 11 | 'AlertDescription', |
| 12 | ] as ComponentType[] |
| 13 | const { props, ref } = useInteractive(component, false) |
| 14 | const { drop, isOver } = useDropComponent(component.id, acceptedTypes) |
| 15 | |
| 16 | let boxProps: any = {} |
| 17 | |
| 18 | if (isOver) { |
| 19 | props.bg = 'teal.50' |
| 20 | } |
| 21 | |
| 22 | return ( |
| 23 | <Box ref={drop(ref)} {...boxProps}> |
| 24 | <Alert {...props}> |
| 25 | {component.children.map((key: string) => ( |
| 26 | <ComponentPreview key={key} componentName={key} /> |
| 27 | ))} |
| 28 | </Alert> |
| 29 | </Box> |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | export default AlertPreview |
nothing calls this directly
no test coverage detected