import React from 'react'; import type { SlateElementProps } from '@udecode/plate'; import type { TCaptionElement } from '@udecode/plate-caption'; import type { TImageElement } from '@udecode/plate-media'; import { cn } from '@udecode/cn'; import { NodeApi, SlateElement } from '@udecode/plate'; export function ImageElementStatic({ children, className, nodeProps, ...props }: SlateElementProps) { const { align = 'center', caption, url, width, } = props.element as TImageElement & TCaptionElement & { width: number; }; return (
{caption && (
{NodeApi.string(caption[0])}
)}
{children}
); }