---
import { Layout } from "virtual:astro-hashnode/components";
import Posts from '../../components/Posts.astro';
import { getAllPosts, getPublication } from '../../hn-gql';

const data = await getAllPosts();
const pub = await getPublication();
const allPosts = data.publication.posts.edges;

---
<Layout pageTitle="Blog">
	<div class="flex flex-col justify-center items-center p-2">
		<h2 class="text-2xl pt-2 font-semibold">{`Welcome to ${pub.displayTitle || pub.title}`}</h2>
		<Posts allPosts={allPosts}/>

	</div>
</Layout>
