2019-08-17 18:18:19 +02:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import Icon from '../Icon'
|
2019-05-18 17:19:47 +02:00
|
|
|
|
2019-08-17 18:18:19 +02:00
|
|
|
const Blockquote = props => {
|
|
|
|
const attr = Object.assign({}, props)
|
|
|
|
delete attr.type
|
|
|
|
delete attr.children
|
2019-05-18 17:19:47 +02:00
|
|
|
return (
|
2019-08-17 18:18:19 +02:00
|
|
|
<blockquote className={props.type} {...attr}>
|
|
|
|
{props.children}
|
2019-10-13 17:31:20 +02:00
|
|
|
{props.type === 'fixme' ? null : <Icon icon={props.type} className={'icon ' + props.type} />}
|
2019-05-18 17:19:47 +02:00
|
|
|
</blockquote>
|
2019-08-17 18:18:19 +02:00
|
|
|
)
|
|
|
|
}
|
2019-05-18 17:19:47 +02:00
|
|
|
|
2019-07-02 19:27:51 +02:00
|
|
|
Blockquote.propTypes = {
|
|
|
|
type: PropTypes.string.isRequired,
|
2019-11-01 17:34:54 +01:00
|
|
|
children: PropTypes.node
|
2019-08-17 18:18:19 +02:00
|
|
|
}
|
2019-07-02 19:27:51 +02:00
|
|
|
|
|
|
|
Blockquote.defaultProps = {
|
2019-08-17 18:18:19 +02:00
|
|
|
type: 'note',
|
2019-11-01 17:34:54 +01:00
|
|
|
children: null
|
2019-08-17 18:18:19 +02:00
|
|
|
}
|
|
|
|
export default Blockquote
|