import Checkbox from '@mui/material/Checkbox'; import FormControlLabel from '@mui/material/FormControlLabel'; import TextField from '@mui/material/TextField'; import Typography from '@mui/material/Typography'; import { ImageUpload, useUiTranslator } from '@react-page/editor'; import React from 'react'; import type { ImageControlType } from '../types/controls'; const ImageControls: ImageControlType = (props) => { const { t } = useUiTranslator(); return ( <> {/* Button and existing image text box */}
{props.imageUpload && ( <> props.onChange({ src: image.url, }) } /> {t(props.translations?.or)} )} props.onChange({ src: e.target.value, }) } />

{/* Image link textbox and checkbox */} props.onChange({ href: e.target.value, }) } /> props.onChange({ openInNewWindow: e.target.checked, }) } /> } label={t(props.translations?.openNewWindow)} />
{/* Image's meta like alt... */} props.onChange({ alt: e.target.value, }) } /> ); }; export default ImageControls;