import { PlateElement } from '@udecode/plate-common' import { forwardRef } from 'react' import { Image } from '@udecode/plate-media' import { image, imageWrapper } from './element.css' import { addMissingCssUnit } from '@editor/utils' export const ImageElement = forwardRef( ( { nodeProps, ...props }: React.ComponentPropsWithoutRef, ref: React.ElementRef, ) => { const width = props.element.width && (typeof props.element.width === 'number' || typeof props.element.width === 'string') ? addMissingCssUnit(props.element.width) : undefined const height = props.element.height && (typeof props.element.height === 'number' || typeof props.element.height === 'string') ? addMissingCssUnit(props.element.height) : undefined return ( {props.children} ) }, )