Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
608 Bytes
import React from 'react';
import { Text } from 'react-native';
import { connectHighlight } from 'react-instantsearch-native';
export default connectHighlight(
({ highlight, attribute, hit, highlightProperty }) => {
const parsedHit = highlight({ attribute, hit, highlightProperty });
const highligtedHit = parsedHit.map((part, idx) => {
if (part.isHighlighted) {
return (
<Text key={idx} style={{ backgroundColor: '#ffff99' }}>
{part.value}
</Text>
);
}
return part.value;
});
return <Text>{highligtedHit}</Text>;
}
);