MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / useHighlight

Function useHighlight

console/src/components/Highlight.tsx:65–70  ·  view source on GitHub ↗
({ text, query, caseSensitive }: UseHighlightProps)

Source from the content-addressed store, hash-verified

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

Callers 1

HighlightFunction · 0.85

Calls 1

highlightWordsFunction · 0.85

Tested by

no test coverage detected