export const description = "Software developer and open-source enthusiast.";

export default function({ nav }) {
  const sortPosts = (a,b) => {
    if (a.data.date < b.data.date) {
      return 1;
    } else if (a.data.date > b.data.date) {
      return -1;
    } else {
      return 0;
    }
  };

  return (
    <>
      <p>
        I am a software developer, open-source enthusiast, lover of pizza, and renegade of funk. I speak fluent English and native Filipino. I also plan on learning German.
      </p>
      <p>
        You'll most likely find me within <a href="https://code.fosterhangdaan.com">my lab</a> tinkering with my inventions and the latest JavaScript frameworks.
        Other times, I help in the battle for an open web and for user privacy by contributing in the development of free and open-source software.
      </p>
      <h2>Contact Me</h2>
      <p>
        The best method of reaching me is through my email: <a href="mailto:foster@hangdaan.email">foster@hangdaan.email</a>.
      </p>
      <p>
        If you'd like an encrypted response, you can send me your GPG public key. You can find mine in the <a href="/gpg-key">GPG Key</a> page.
      </p>
      <h2>Projects</h2>
      <ul>
        <li>
          <a href="https://code.fosterhangdaan.com/foster/grub-themes">GRUB Themes</a> &mdash; collection of themes for the GRand Unified Bootloader
        </li>
        <li>
          <a href="https://code.fosterhangdaan.com/foster/website">This website</a> &mdash; my personal website &amp; blog
        </li>
        <li>
          <a href="https://code.fosterhangdaan.com/foster/bitcoin-core-container">Bitcoin Core Container</a> &mdash; A containerized Bitcoin node
        </li>
        <li>
          <a href="https://code.fosterhangdaan.com/foster/monero-node-container">Monero Node Container</a> &mdash; A containerized Monero node
        </li>
        <li>
          <a href="https://code.fosterhangdaan.com/foster/electrum-container">Electrum Container</a> &mdash; A containerized Electrum server powered by Electrs
        </li>
      </ul>
      <p>
        <a href="https://code.fosterhangdaan.com/foster?tab=repositories">View all projects</a>
      </p>
      <h2>Latest Blog Posts</h2>
      <ul>
        {nav.menu("/blog/posts").children.sort(sortPosts).slice(0,3).map(post => (
          <li>
            <a href={post.data.url} >{post.data.title}</a> &mdash; <time className="post-list-date">{Intl.DateTimeFormat("en-CA", { dateStyle: "long" }).format(post.data.date)}</time>
          </li>
        ))}
      </ul>
      <p>
        <a href="/blog">View all blog posts</a>
      </p>
    </>
  );
}
