import React, { useState } from 'react'; import { Button, TextField, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, FormControlLabel, Switch } 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 [isInstagramLink, setIsInstagramLink] = useState(false); const handleClose = () => { setIsOpen(false); }; const handleSubmit = () => { const result = isInstagramLink ? `${url.slice(0, url.length - 29)}/media/?size=l` : url; callback(result || ''); handleClose(); }; const handleChange = (event:React.ChangeEvent) => { setUrl(event.target.value); }; const handleSwitch = () => { setIsInstagramLink(!isInstagramLink); }; return (
Upload an Image Unfortunetly we do not support uploading images yet. Please provide a valid URL to your image: } label="It's an Instagram link" />
); }; export default UploadImage;