import { BlockConfig, FileBlockConfig } from "@blocknote/core"; import { CSSProperties, ReactNode } from "react"; import { useUploadLoading } from "../../../../hooks/useUploadLoading.js"; import { ReactCustomBlockRenderProps } from "../../../../schema/ReactBlockSpec.js"; import { AddFileButton } from "./AddFileButton.js"; import { FileNameWithIcon } from "./FileNameWithIcon.js"; export const FileBlockWrapper = ( props: Omit< ReactCustomBlockRenderProps< BlockConfig< FileBlockConfig["type"], FileBlockConfig["propSchema"] & { showPreview?: { default: true } }, FileBlockConfig["content"] > >, "contentRef" > & { buttonIcon?: ReactNode; children?: ReactNode; } & { // These props & the `forwardRef` are just here so we can reuse this // component in `ResizableFileBlockWrapper`. onMouseEnter?: () => void; onMouseLeave?: () => void; style?: CSSProperties; }, ) => { const showLoader = useUploadLoading(props.block.id); return (
{props.block.props.caption}
)} > )}