spaCy/website/src/components/list.js

18 lines
576 B
JavaScript
Raw Normal View History

import React from 'react'
2020-09-12 18:40:50 +03:00
import classNames from 'classnames'
import classes from '../styles/list.module.sass'
2020-09-12 18:40:50 +03:00
import { replaceEmoji } from './icon'
export const Ol = props => <ol className={classes.ol} {...props} />
export const Ul = props => <ul className={classes.ul} {...props} />
2020-09-12 18:40:50 +03:00
export const Li = ({ children, ...props }) => {
const { hasIcon, content } = replaceEmoji(children)
const liClassNames = classNames(classes.li, { [classes.liIcon]: hasIcon })
return (
<li className={liClassNames} {...props}>
{content}
</li>
)
}