diff --git a/astro/src/components/Post.astro b/astro/src/components/PostEntry.astro similarity index 91% rename from astro/src/components/Post.astro rename to astro/src/components/PostEntry.astro index 92d0071..9eebf7f 100644 --- a/astro/src/components/Post.astro +++ b/astro/src/components/PostEntry.astro @@ -1,5 +1,10 @@ --- import { Image } from "@astrojs/image/components"; +import type { Post } from "@/types/payload-types"; + +interface Props { + post: Post; +} const { post } = Astro.props; --- diff --git a/astro/src/components/Posts.astro b/astro/src/components/Posts.astro index 7ea4b60..ce5fe9f 100644 --- a/astro/src/components/Posts.astro +++ b/astro/src/components/Posts.astro @@ -1,5 +1,10 @@ --- -import Post from "@/components/Post.astro" +import PostEntry from "@/components/PostEntry.astro" +import type { Post } from "@/types/payload-types"; + +interface Props { + posts: Post[]; +} const { posts } = Astro.props; --- @@ -10,8 +15,9 @@ const { posts } = Astro.props; { posts.length > 0 ? ( posts.map((post) => ( - - )) + typeof(post) === 'object') && + + ) ) : (

No posts available

)