{"size": 924, "ext": "js", "max_stars_repo_path": "src/slots/IsolateButton.js", "max_stars_repo_name": "pnepe6/rsg-components", "max_stars_repo_stars_event_min_datetime": "2018-11-29T04:33:59.000Z", "max_stars_repo_stars_event_max_datetime": "2019-05-21T09:14:54.000Z", "max_issues_repo_path": "src/slots/IsolateButton.js", "max_issues_repo_name": "pnepe6/rsg-components", "max_issues_repo_issues_event_min_datetime": "2018-11-30T00:13:34.000Z", "max_issues_repo_issues_event_max_datetime": "2020-04-25T10:57:32.000Z", "max_forks_repo_path": "src/slots/IsolateButton.js", "max_forks_repo_name": "pnepe6/rsg-components", "max_forks_repo_forks_event_min_datetime": "2019-05-22T17:07:05.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-22T17:07:05.000Z"}
{"max_stars_count": 6, "max_issues_count": 92, "max_forks_count": 1, "avg_line_length": 36.96, "max_line_length": 90, "alphanum_fraction": 0.7056277056}
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import getUrl from 'react-styleguidist/lib/client/utils/getUrl';
import ToolbarButton from '../ToolbarButton';

const IsolateButton = ({ name, example, isolated }) =>
  isolated ? (
    <ToolbarButton href={getUrl({ anchor: true, slug: '/' })} title="Show all components">
      <FontAwesomeIcon icon={['fas', 'angle-double-left']} />
    </ToolbarButton>
  ) : (
    <ToolbarButton href={getUrl({ name, example, isolated: true })} title="Open isolated">
      <FontAwesomeIcon icon={['fas', 'arrows-alt']} />
    </ToolbarButton>
  );

IsolateButton.propTypes = {
  name: PropTypes.string.isRequired,
  example: PropTypes.number, // eslint-disable-line react/require-default-props
  isolated: PropTypes.bool, // eslint-disable-line react/require-default-props
};

export default IsolateButton;
