1
0
Fork 0
freesewing/packages/components/src/Blockquote/index.js

27 lines
591 B
JavaScript
Raw Normal View History

import React from 'react'
import PropTypes from 'prop-types'
import Icon from '../Icon'
const Blockquote = props => {
const attr = Object.assign({}, props)
delete attr.type
delete attr.children
return (
<blockquote className={props.type} {...attr}>
{props.children}
{props.type === 'fixme' ? null : <Icon icon={props.type} className={'icon ' + props.type} />}
</blockquote>
)
}
2019-07-02 19:27:51 +02:00
Blockquote.propTypes = {
type: PropTypes.string.isRequired,
children: PropTypes.node
}
2019-07-02 19:27:51 +02:00
Blockquote.defaultProps = {
type: 'note',
children: null
}
export default Blockquote