import React, { ComponentProps, useEffect, useRef, useState } from 'react' import { FaImage } from 'react-icons/fa'; import { CgArrowsExchangeV } from 'react-icons/cg'; import { IoMdClose } from 'react-icons/io'; import { RotatingLines } from 'react-loader-spinner'; import { Nullable } from 'remirror'; import SingleImageUploadInput from '../SingleImageUploadInput/SingleImageUploadInput' import { motion } from 'framer-motion'; import { AiOutlineCloudUpload } from 'react-icons/ai'; import { useIsDraggingOnElement } from 'src/utils/hooks'; type Value = ComponentProps['value'] interface Props { value: Value; rounded?: string; onChange: (new_value: Nullable) => void } export default function CoverImageInput(props: Props) { const dropAreaRef = useRef(null!) const isDragging = useIsDraggingOnElement({ ref: dropAreaRef }); return (
{!img &&

Drop a COVER IMAGE here or
Click to browse
} {img && <> {!isUploading &&
} } {isUploading &&
} {isDraggingOnWindow &&

Drop here to upload
}
} />
) }