This commit is contained in:
2024-05-21 00:12:19 +02:00
parent 9e0466f78b
commit 963987278a
22 changed files with 1025 additions and 90 deletions
+7 -3
View File
@@ -1,15 +1,19 @@
import { graphql } from "@/gql";
//import { NewsFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { NewsList } from "@/components/news/NewsList";
import Link from "next/link";
import { PageHeader } from "@/components/general/PageHeader";
import { newsQuery, NewsFragment, NewsIndexFragment } from "@/lib/news";
export default async function Page() {
const { data, error } = await getClient().query(newsQuery, {});
const news = (data?.news ?? []) as NewsFragment[];
const index = (data?.index ?? []) as NewsIndexFragment;
return (
<main className="site-main" id="main">
<PageHeader heading="Siste nytt" />
<NewsList />
<PageHeader heading={index.title} lead={index.lead} />
<NewsList news={news} />
</main>
);
}