{"size": 521, "ext": "js", "max_stars_repo_path": "boolgram/src/stories/StoriesContainer.js", "max_stars_repo_name": "mikemherron/boolgram", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "boolgram/src/stories/StoriesContainer.js", "max_issues_repo_name": "mikemherron/boolgram", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "boolgram/src/stories/StoriesContainer.js", "max_forks_repo_name": "mikemherron/boolgram", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.7083333333, "max_line_length": 73, "alphanum_fraction": 0.7140115163}
import React from 'react';

import { GET_PROFILES_URL } from 'api/BoolgramApi';
import useFetchJson from 'api/useFetchJson';
import Stories from './Stories';
import Error from 'error/Error';

function StoriesContainer() {

  const [profiles, isLoading, hasError] = useFetchJson(GET_PROFILES_URL);

  if (hasError) {
    return <Error message="Unable to load stories" />;
  }

  if (isLoading) {
    return <Stories showLoading={true} />;
  }

  return <Stories profiles={profiles} />;
}

export default StoriesContainer;
