import { MainLayout } from "@/layout/MainLayout/MainLayout";
import Link from "next/link";

export default async function Home() {
  const data = await fetch("https://pronouns.cc/api/v1/users/mtr", { next: { revalidate: 3600 } }).then(x=>x.json());

  return (
    <MainLayout currentPage="/links/" title="Links" subtitle="to other places I've been">
      <img className="headerImage" src="/headers/links.png" alt="LINKS"></img>
      {data.links.map((link:string) => (
        <div style={{
          margin: "16px 0"
        }}>
          <h2>{new URL(link).host}</h2>
          <p><Link href={link} target="_blank">{link}</Link></p>
        </div>
      ))}
    </MainLayout>
  )
}