import BasicPage from "../../components/basic-page";
import FBlock from "../../components/faq-block";

// An object listing pages folks can visit
export async function getStaticProps() {
  const fs = require("fs");
  const yaml = require("js-yaml");
  let FAQ = {};

  try {
    let fileContent = fs.readFileSync("./data/faq.yml", "utf8");
    FAQ = yaml.load(fileContent);
  } catch (e) {
    console.log(e);
  }
  return {
    props: {
      FAQ,
    },
  };
}

export default function FAQ({ FAQ }) {
  return (
    <BasicPage page_title="FAQ" card_title="Frequently Asked Questions!">
      <FBlock faqs={FAQ} />
    </BasicPage>
  );
}
