What I assume is you are trying to pass the getFeaturedPosts to the component FeaturedPosts, the issues lies here:
export async function getStaticProps() {
console.log("getStaticProps called");
const featuredPosts = getFeaturedPosts();
console.log("Featured posts in getStaticProps:", featuredPosts); // Debugging line
return {
props: {
posts: featuredPosts,
},
revalidate: 1800,
};
}
pass the function to the component instead
<FeaturedPosts posts={featuredPosts} />
the other issue could be related to folder structure it should be like app/posts/page.tsx