saagie-ui
Version:
Saagie UI from Saagie Design System
41 lines (35 loc) • 868 B
JavaScript
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,
className: PropTypes.string,
defaultClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
};
const defaultProps = {
tag: 'div',
className: '',
defaultClassName: '',
};
export const BreadcrumbItem = ({
children,
tag: Tag,
defaultClassName,
className,
...attributes
}) => {
const classes = classnames(
defaultClassName,
className
);
return (
<Tag className={classes} {...attributes}>{children}</Tag>
);
};
BreadcrumbItem.propTypes = propTypes;
BreadcrumbItem.defaultProps = defaultProps;