src/components/search/search-results.tsximport { Fragment } from 'react'import Link from 'next/link'import Highlighter from 'react-highlight-words'import {type AutocompleteApi,type AutocompleteCollection,} from '@algolia/autocomplete-core'import { type Result } from './search-client'/*** Extract context around the search query from content* @param content - The full content text* @param query - The search query* @param contextLength - Number of characters to show on each side* @returns Excerpt with query in context, or beginning of content*/function getContextExcerpt(content: string,query: string,
Showing the first 20 lines.
Get full code