text: import Layout from "../components/Layout";
  import CollapseGroup from "../components/CollapseGroup";
  import BibTexUtils from "../utils/bibtex-util";
  
  function processGroup(title, entries) {
  
      let items = entries.map((entry, i) => {
          return (
              <li className="ms-1" key={i}>
                  <span dangerouslySetInnerHTML={{__html: entry}} />
              </li>
          );
      });
  
      return (
          <CollapseGroup title={title} key={title} id={`year-${title}`}>
              <ul>
                  {items}
              </ul>
          </CollapseGroup>
      );
  }
  
  function Page(props) {
  
      let items = [];
  
      const years = Object.keys(props.data).sort((a, b) => b - a);
  
      years.forEach((year, i) => {
          items.push(processGroup(year, props.data[year]));
      });
  
      return (
          <Layout page="Publications">
  
              <p>This is not the full list. I will update it as soon as possible.</p>
  
              {items}
  
          </Layout>
      );
  }
  
  export function getStaticProps(context) {
      return {
          props: {
              data: BibTexUtils.parse("data/references.bib")
          },
      };
  }
  
  export default Page;
  