import React from 'react'; import { iconStyle } from './../common/styles'; import type { CellPluginComponentProps } from '@react-page/editor'; import { lazyLoad } from '@react-page/editor'; import type { ImageState } from '../types/state'; const ImageIcon = lazyLoad(() => import('@mui/icons-material/Landscape')); const ImageHtmlRenderer: React.FC> = ( props ) => { const { data } = props; const src = data?.src; const alt = data?.alt; const openInNewWindow = data?.openInNewWindow; const image = ( {alt} ); return src ? (
{data?.href ? ( e.preventDefault() : undefined} href={data?.href} target={openInNewWindow ? '_blank' : undefined} rel={openInNewWindow ? 'noreferrer noopener' : undefined} > {image} ) : ( image )}
) : (
); }; export default ImageHtmlRenderer;