import React from 'react' ; import { memoForwardRef } from "../react/ReactUtils" ; import { DOMTextHit } from "polar-dom-text-search/src/DOMTextHit" ; import { DOMHighlight } from "./DOMHighlight" ; interface IProps { readonly hits : ReadonlyArray < DOMTextHit > ; } export const DOMHighlights = memoForwardRef ( function DOMHighlights ( props ) { function toDOMHighlight ( hit ) { return < DOMHighlight key = { hit . id } { ... hit } />; } return ( < > { props . hits . map ( toDOMHighlight ) } < />); } ) ;