import { Heading } from '@chakra-ui/react'; import { useHotkeys } from 'react-hotkeys-hook'; type ImageUploadOverlayProps = { isDragAccept: boolean; isDragReject: boolean; overlaySecondaryText: string; setIsHandlingUpload: (isHandlingUpload: boolean) => void; }; const ImageUploadOverlay = (props: ImageUploadOverlayProps) => { const { isDragAccept, isDragReject, overlaySecondaryText, setIsHandlingUpload, } = props; useHotkeys('esc', () => { setIsHandlingUpload(false); }); return (
{isDragAccept && (
Upload Image{overlaySecondaryText}
)} {isDragReject && (
Invalid Upload Must be single JPEG or PNG image
)}
); }; export default ImageUploadOverlay;