2022-06-17 17:44:08 +00:00
|
|
|
/* Notes */
|
|
|
|
|
|
|
|
// This function is just a simple wrapper around lib/comparisonView.
|
|
|
|
// Most of the time, I'll want to edit that instead
|
|
|
|
|
|
|
|
/* Imports */
|
|
|
|
import React from "react";
|
|
|
|
import fs from "fs";
|
|
|
|
import path from "path";
|
|
|
|
import Homepage from "../lib/comparisonView.js";
|
|
|
|
|
|
|
|
/* Definitions */
|
|
|
|
const elementsDocument = "../data/listForTemplate.json";
|
|
|
|
|
|
|
|
/* React components */
|
|
|
|
export async function getStaticProps() {
|
|
|
|
const directory = path.join(process.cwd(), "pages");
|
|
|
|
let listOfElementsForView = JSON.parse(
|
|
|
|
fs.readFileSync(path.join(directory, elementsDocument), "utf8")
|
|
|
|
);
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
listOfElementsForView,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// Main react component
|
|
|
|
export default function Home({ listOfElementsForView }) {
|
2022-06-18 18:30:14 +00:00
|
|
|
return <Homepage listOfElementsForView={listOfElementsForView} />;
|
2022-06-17 17:44:08 +00:00
|
|
|
}
|