import BasicPage from "../../components/basic-page";
import WCard from "../../components/werefox-card";
import SBlock from "../../components/server-block";

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

  try {
    let fileContent = fs.readFileSync("./data/servers.yml", "utf8");
    SERVERS = yaml.load(fileContent);
  } catch (e) {
    console.log(e);
  }
  return {
    props: {
      SERVERS,
    },
  };
}
export default function Servers({ SERVERS }) {
  return (
    <BasicPage page_title="Servers" card_title="Here are my server specs!">
      <WCard innerText="Servers">
        <SBlock servers={SERVERS} />
      </WCard>
    </BasicPage>
  );
}
