// @flow import * as React from 'react'; import classnames from 'classnames'; import './Badgeable.scss'; type Props = { /** Component to render when badging the bottom left corner of the rendered container */ bottomLeft?: React.Node, /** Component to render when badging the bottom right corner of the rendered container */ bottomRight?: React.Node, /** the item(s) to receive the badge */ children: React.Node, className?: string, /** Component to render when badging the top left corner of the rendered container */ topLeft?: React.Node, /** Component to render when badging the top right corner of the rendered container */ topRight?: React.Node, }; const Badgeable = (props: Props) => { const { children, className = '', topLeft = null, topRight = null, bottomLeft = null, bottomRight = null } = props; return (
{children}
{topLeft &&
{topLeft}
} {topRight &&
{topRight}
} {bottomLeft &&
{bottomLeft}
} {bottomRight &&
{bottomRight}
}
); }; export default Badgeable;