import React from "react"; import type { EL } from "../../node/el"; // eslint-disable-next-line no-irregular-whitespace export const HTMLMarginSpan: React.FC> = props =>  ; export type WrapperComponentProps = { htmlComponentID: string; childProps: HTMLComponentProps; ChildComponent: React.ComponentType; }; export interface HTMLFigData { url: string, type: string, } export type HTMLGetFigData = ( (src: string) => | HTMLFigData | null ); export interface HTMLOptions { WrapComponent?: React.FC; renderControlEL?: boolean; getFigData?: HTMLGetFigData; renderPDFAsLink?: boolean; annotateLawtextRange?: boolean; options?: object; } export interface HTMLComponentProps { htmlOptions: HTMLOptions; } export function wrapHTMLComponent(htmlComponentID: TComponentID, Component: React.ComponentType

) { const ret = ((props: P & HTMLComponentProps) => { const { htmlOptions } = props; if (htmlOptions.WrapComponent) { return ( } /> ); } else { return ; } }) as React.FC

& {componentID: TComponentID}; ret.componentID = htmlComponentID; return ret; } export const elProps = (el: EL, htmlOptions: HTMLOptions) => { const ret: Record = {}; if (htmlOptions.annotateLawtextRange && el.range) { ret["data-lawtext_range"] = JSON.stringify(el.range); ret["data-el_id"] = JSON.stringify(el.id); } return ret; };