import React from 'react'; import cx from 'classnames'; import PropTypes from 'prop-types'; import s from './Widget.module.scss'; const Widget = ({ children, className, title }) => (
{title ? typeof title === 'string' ?
{title}
:
{title}
: null}
{children}
); Widget.propTypes = { title: PropTypes.node, className: PropTypes.string, children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]), }; Widget.defaultProps = { title: null, className: '', children: [], }; export default Widget;