import BasicPage from "../../components/basic-page";
import WCard from "../../components/werefox-card";
import CBlock from "../../components/contacts-block";

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

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

export default function Contacts({ CONTACTS }) {
  return (
    <BasicPage
      page_title="Where To Find Me"
      card_title={`"Do you have a [Social Media]?"`}
    >
      <WCard innerText="You can find me in quite a few places!">
        <CBlock contacts={CONTACTS} />
      </WCard>
    </BasicPage>
  );
}
