import { auth } from "@/server/auth";
import { api } from "@/trpc/server";
import Link from "next/link";

export default async function Home() {
  const session = await auth();
  const articles = await api.article.getAllPreviews();
  return (
    <div className="">
      <h1 className="text-4xl font-bold">Anti Rechts Wiki</h1>

      <menu>
        {articles.map((article) => (
          <li key={article.slug}>
            <Link href={`/artikel/${article.slug}`}>{article.title}</Link>
          </li>
        ))}
      </menu>
    </div>
  );
}
