<commit_before>/**
 * React Starter Kit (https://www.reactstarterkit.com/)
 *
 * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

import React from 'react';
import Home from './Home';
// import fetch from '../../core/fetch';
import Layout from '../../components/Layout';

export default {

  path: '/',

  action() {
    // const resp = await fetch('/graphql', {
       //   method: 'post',
       //   headers: {
       //     Accept: 'application/json',
       //     'Content-Type': 'application/json',
       //   },
       //   body: JSON.stringify({
       //     query: '{news{title,link,contentSnippet}}',
       //   }),
       //   credentials: 'include',
       // });
       // const { data } = await resp.json();
    const data = {
      news: [
        {
          title: 'new title',
          link: '/about',
          contentSnippet: 'balba',
          content: 'hi there',
        },
      ],
    };
       // if (!data || !data.news) throw new Error('Failed to load the news feed.');

    return {
      title: 'React Starter Kit',
      component: <Layout><Home news={data.news} /></Layout>,
    };
  },

};<commit_msg>Revert "running"<commit_after>/**
 * React Starter Kit (https://www.reactstarterkit.com/)
 *
 * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

import React from 'react';
import Home from './Home';
import fetch from '../../core/fetch';
import Layout from '../../components/Layout';

export default {

  path: '/',

  async action() {
    const resp = await fetch('/graphql', {
      method: 'post',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        query: '{news{title,link,publishedDate,contentSnippet}}',
      }),
      credentials: 'include',
    });
    const { data } = await resp.json();
    if (!data || !data.news) throw new Error('Failed to load the news feed.');
    return {
      title: 'React Starter Kit',
      component: <Layout><Home news={data.news} /></Layout>,
    };
  },

};
{'fraction_non_alphanumeric': 0.16566265060240964, 'fraction_numerical': 0.0068846815834767644, 'mean_word_length': 2.206896551724138, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7116487', 'n_tokens_mistral': 684, 'n_tokens_neox': 670, 'n_words': 207}