UNPKG

saagie-ui

Version:

Saagie UI from Saagie Design System

42 lines (35 loc) 888 B
import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; const propTypes = { children: PropTypes.node.isRequired, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ tag: PropTypes.elementType, defaultClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), className: PropTypes.string, }; const defaultProps = { tag: 'div', defaultClassName: 'sui-o-notification', className: '', }; export const Notification = (props) => { const { tag: Tag, defaultClassName, className, ...attributes } = props; const classes = classnames( defaultClassName, className ); return ( <Tag {...attributes} className={classes} /> ); }; Notification.propTypes = propTypes; Notification.defaultProps = defaultProps;