import { Box } from '@chakra-ui/react'; import { TypesafeDroppableData, isValidDrop, useDroppable, } from 'app/components/ImageDnd/typesafeDnd'; import { AnimatePresence } from 'framer-motion'; import { ReactNode, memo, useRef } from 'react'; import { v4 as uuidv4 } from 'uuid'; import IAIDropOverlay from './IAIDropOverlay'; type IAIDroppableProps = { dropLabel?: ReactNode; disabled?: boolean; data?: TypesafeDroppableData; }; const IAIDroppable = (props: IAIDroppableProps) => { const { dropLabel, data, disabled } = props; const dndId = useRef(uuidv4()); const { isOver, setNodeRef, active } = useDroppable({ id: dndId.current, disabled, data, }); return ( {isValidDrop(data, active) && ( )} ); }; export default memo(IAIDroppable);