import PropTypes from 'prop-types';

import { withSite } from './withSite';

/* Interface */
const propTypes = {
  /**
   * StoryShare `Site`.
   * @private
   */
  site: PropTypes.object.isRequired,
};

/**
 * Site name from SS configuration
 * @param {Object} props - React component props.
 * @returns {string} Site name
 */
export const SiteName = ({ site }) => site.getSchema().name;

SiteName.propTypes = propTypes;

export default withSite(SiteName);
