import React, { useState } from 'react'; import { Button, TextField, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@material-ui/core'; interface PropTypes { isOpen: boolean; setIsOpen: (value: boolean) => void; callback: (url: string) => void; } const UploadImage: React.FC = ({ setIsOpen, isOpen, callback }) => { const [url, setUrl] = useState(''); const handleClose = () => { setIsOpen(false); }; const handleSubmit = () => { let result = url; if (url.startsWith('https://www.instagram.com/')) { const lastSlashIndex = url.lastIndexOf('/'); const baseUrl = url.slice(0, lastSlashIndex); result = `${baseUrl}/media/?size=l`; } callback(result || ''); handleClose(); }; const handleChange = (event:React.ChangeEvent) => { setUrl(event.target.value); }; return (
Upload an Image Unfortunetly we do not support uploading images yet. Please provide a valid URL to your image:
); }; export default UploadImage;