{"size": 1036, "ext": "js", "max_stars_repo_path": "pages/collection.js", "max_stars_repo_name": "marcodellemarche/commercejs-nextjs-demo-store", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "pages/collection.js", "max_issues_repo_name": "marcodellemarche/commercejs-nextjs-demo-store", "max_issues_repo_issues_event_min_datetime": "2021-11-30T00:20:06.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-06T17:35:08.000Z", "max_forks_repo_path": "pages/collection.js", "max_forks_repo_name": "marcodellemarche/commercejs-nextjs-demo-store", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 27.2631578947, "max_line_length": 73, "alphanum_fraction": 0.6496138996}
import React from 'react';
import Head from 'next/head';
import Root from '../components/common/Root';
// import ExploreBanner from '../components/productAssets/ExploreBanner';
import Collections from '../components/collections/Collections';
// import SocialMedia from '../components/common/SocialMedia';
import Footer from '../components/common/Footer';
import { useTranslation } from 'react-i18next';
import siteConfig from '../utils/siteConfig.js';
import commerce from '../lib/commerce.js';

const Home = () => {
  const {t} = useTranslation();

  return (
    <Root>
      <Head>
        <title>{t('routes.shop')} | {siteConfig.title}</title>
      </Head>
      <Collections />
      {/* <ExploreBanner /> */}
      {/* <SocialMedia /> */}
      <Footer />
    </Root>
  );
};

export default Home;

export async function getStaticProps() {
  const [{ data: products }, { data: categories }] = await Promise.all([
    commerce.products.list(),
    commerce.categories.list(),
  ]);

  return { props: { products, categories } }
}
