File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
examples/react-renderer/src Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import { Hit } from '@algolia/client-search';
8
8
import algoliasearch from 'algoliasearch/lite' ;
9
9
import React from 'react' ;
10
10
11
- import { Highlight } from './Highlight' ;
12
11
import { ClearIcon } from './ClearIcon' ;
12
+ import { Highlight } from './Highlight' ;
13
13
import { SearchIcon } from './SearchIcon' ;
14
14
15
15
const searchClient = algoliasearch (
@@ -170,9 +170,7 @@ export function Autocomplete(
170
170
/>
171
171
</ div >
172
172
< div className = "aa-ItemContentBody" >
173
- < div
174
- className = "aa-ItemContentTitle"
175
- >
173
+ < div className = "aa-ItemContentTitle" >
176
174
< Highlight hit = { item } attribute = "name" />
177
175
</ div >
178
176
< div className = "aa-ItemContentDescription" >
Original file line number Diff line number Diff line change 1
- import { createElement , Fragment } from "react" ;
2
- import { parseAlgoliaHitHighlight } from "@algolia/autocomplete-preset-algolia" ;
1
+ import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia' ;
2
+ import { createElement , Fragment } from 'react' ;
3
3
4
4
type HighlightHitParams < THit > = {
5
5
/**
@@ -23,14 +23,16 @@ type HighlightHitParams<THit> = {
23
23
export function Highlight < THit > ( {
24
24
hit,
25
25
attribute,
26
- tagName = " mark" ,
26
+ tagName = ' mark' ,
27
27
} : HighlightHitParams < THit > ) : JSX . Element {
28
28
return createElement (
29
29
Fragment ,
30
30
{ } ,
31
31
parseAlgoliaHitHighlight < THit > ( { hit, attribute } ) . map (
32
32
( { value, isHighlighted } , index ) => {
33
- if ( isHighlighted ) return createElement ( tagName , { key : index } , value ) ;
33
+ if ( isHighlighted ) {
34
+ return createElement ( tagName , { key : index } , value ) ;
35
+ }
34
36
35
37
return value ;
36
38
}
You can’t perform that action at this time.
0 commit comments