import React from 'react';
import PropTypes from 'prop-types';

const propTypes = {
  children: PropTypes.node,
  className: PropTypes.string,
  /**
   * The component used for the root node.
   * Either a string to use a DOM element or a component.
   */
  tag: PropTypes.elementType,
};

const defaultProps = {
  children: '',
  className: '',
  tag: 'div',
};

export const SecondLevelNavTitle = ({
  children,
  className,
  tag: Tag,
  ...props
}) => (
  <Tag className={`sui-l-second-level-nav__title ${className}`} {...props}>
    {children}
  </Tag>
);

SecondLevelNavTitle.propTypes = propTypes;
SecondLevelNavTitle.defaultProps = defaultProps;
