import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

import React from "react";
import ReactDOM from "react-dom";
import Main from "../src/Main.js"
import TemplatePage from "../src/components/jamtracks/JKJamTracksLandingTemplatePage.js"
import ArtistTemplatePage from "../src/components/jamtracks/JKJamTracksArtistLandingTemplatePage.js"
import '../src/helpers/initFA';
import '../src/i18n/config';

const rootElement = document.getElementById("root");

// Ensure props are passed correctly (or fetch from the server)

const props = window.jamtrack_data;

console.log('init', props, rootElement);

// Hydrate the server-rendered React component
//ReactDOM.hydrate(React.createElement(TemplatePage, props), rootElement);

ReactDOM.render(
 <Main>
   {props.song ? <TemplatePage {...props} /> : <ArtistTemplatePage {...props} /> }
 </Main>, rootElement
 );


