Sha256: 68d539df7eae92e04dba30939195527300acd20f3788f4bb18f2194fcaf23dca
Contents?: true
Size: 888 Bytes
Versions: 44
Compression:
Stored size: 888 Bytes
Contents
/* @flow */ /* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */ import Highlighter from 'react-highlight-words' import React from 'react' import classnames from 'classnames' import { spacing } from '../utilities/spacing.js' type HighlightProps = { className?: String, data?: String, id?: String, children?: React.Node, text?: String, highlightedText?: Array<String>, } const Highlight = (props: HighlightProps) => { const { className = 'pb_highlight_kit', children, data, id, text, highlightedText = ['highlight'], } = props return ( <Highlighter autoEscape data={data} highlightClassName={classnames(className, spacing(props))} highlightTag="span" id={id} searchWords={highlightedText} textToHighlight={text || children} /> ) } export default Highlight
Version data entries
44 entries across 44 versions & 1 rubygems