import { getSortedPostsData } from '@/lib/posts';
import BlogArea from '@/components/blogpost';

export default function Home() {
  const blogposts = getSortedPostsData();
  
  const formattedPosts = blogposts.map(post => ({
    label: post.title,
    body: post.description,
    publish: new Date(post.date).toLocaleDateString('ru-RU', {
      day: 'numeric',
      month: 'long',
      year: 'numeric',
    }),
    get_absolute_url: `/post/${post.slug}`,
    tags: post.tags,
  }));

  return <BlogArea blogposts={formattedPosts} />;
}