({ text, query, caseSensitive }: UseHighlightProps)
| 63 | return result.map((str) => ({ text: str, match: regex.test(str) })); |
| 64 | } |
| 65 | function useHighlight({ text, query, caseSensitive }: UseHighlightProps) { |
| 66 | return useMemo( |
| 67 | () => highlightWords({ text, query, caseSensitive }), |
| 68 | [text, query, caseSensitive], |
| 69 | ); |
| 70 | } |
| 71 | |
| 72 | const Highlight = (props: HighlightProps) => { |
| 73 | const { children, query, styles, caseSensitive } = props; |
no test coverage detected