import { getPublishedPosts } from "@/lib/store";
import HeroSection from "@/components/HeroSection";
import { FeaturedGrid, RecentList } from "@/components/PostSections";

export default async function HomePage() {
  const posts = await getPublishedPosts();
  const featuredPosts = posts.filter((p) => p.featured);
  const recentPosts = posts.slice(0, 5);

  return (
    <>
      <HeroSection />
      <FeaturedGrid posts={featuredPosts} />
      <RecentList posts={recentPosts} />
    </>
  );
}
