import React from "react" ; interface HighlightCharsProps { str : string ; indices : Set < number > ; } export const HighlightChars = ( props ) => { const strArr = props . str . split ( "" ) ; const nodes = strArr . map ( ( v , i ) => { if ( props . indices . has ( i ) ) { return ( < span key = { i } className = "font-semibold" > { v } < /span>); } else { return v ; } } ) ; return < > { nodes } < />; } ;