);
}
/**
* Highlights the search query in the text by wrapping it in a span with the
* font-extrabold class.
* @param query The search query
* @param text The text to highlight
* @returns The text with the query highlighted
*/
function highlightSearchQuery(query: string, text: string) {
const sanitizedQuery = query.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
return text.split(new RegExp(`(${sanitizedQuery})`, 'gi')).map((part, i) => (
{part}
));
}