import BasicPage from "../../../components/basic-page";
import IDCard from "../../../components/identity-card";

export async function getStaticProps() {
  const fs = require("fs");
  const yaml = require("js-yaml");
  let NEURO = "";

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

export default function Neurodiversity({ NEURO }) {
  return (
    <BasicPage
      page_title={NEURO["Neuro"].page_title}
      card_title={NEURO["Neuro"].card_title}
    >
      {Object.keys(NEURO).map((neuro) => (
        <IDCard
          key={neuro}
          title={NEURO[neuro].title}
          info={NEURO[neuro].info}
          url={NEURO[neuro].url}
          src={NEURO[neuro].src}
          alt={NEURO[neuro].alt}
        />
      ))}
    </BasicPage>
  );
}
