import { createFileBlockConfig, fileParse } from "@blocknote/core"; import { createReactBlockSpec } from "../../schema/ReactBlockSpec.js"; import { FileBlockWrapper } from "./helpers/render/FileBlockWrapper.js"; import { LinkWithCaption } from "./helpers/toExternalHTML/LinkWithCaption.js"; export const ReactFileBlock = createReactBlockSpec(createFileBlockConfig, { render: (props) => , parse: fileParse(), toExternalHTML: (props) => { if (!props.block.props.url) { return

Add file

; } const link = ( {props.block.props.name || props.block.props.url} ); if (props.block.props.caption) { return ( {link} ); } return link; }, });