import Link from 'next/link';
import { getAllPostsMeta } from '@/lib/posts';

export default function BlogIndex() {
  const posts = getAllPostsMeta();
  return (
    <main>
      <h1>Blog</h1>
      <ul>
        {posts.map((post) => (
          <li key={post.slug}>
            <Link href={`/${post.slug}`}>{post.title}</Link>
            <p>{post.description}</p>
          </li>
        ))}
      </ul>
    </main>
  );
}