import BasicPage from "../../components/basic-page";
import PBlock from "../../components/project-block";

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

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

export default function Services({ PROJECTS }) {
  return (
    <BasicPage page_title="Personal Projects" card_title="Some stuff I do!">
      <div className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker bg-werefox-grey-light dark:bg-werefox-grey">
        <PBlock title="Personal Projects" cards={PROJECTS} />
      </div>
    </BasicPage>
  );
}
