import PropTypes from 'prop-types';
import NameLink from './NameLink';
import classes from './styles.module.scss';
const Name = function Name(props) {
  const {
    name: nameData
  } = props;
  const nameAndTag = typeof nameData === 'string' ? {
    name: nameData
  } : nameData;
  const {
    name,
    tagline,
    link
  } = nameAndTag;
  return <span>
      <span className={classes.name}>
        <NameLink name={name} link={link} />
      </span>
      {tagline && <>
          {' '}
          <span className={classes.tagline}>
            {tagline}
          </span>
        </>}
    </span>;
};
Name.propTypes = {
  name: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
    name: PropTypes.string,
    tagline: PropTypes.string,
    link: PropTypes.string
  })]).isRequired
};
export default Name;