generated from autonomic-cooperative/astro-payload-template
Type posts
This commit is contained in:
parent
62e50496a2
commit
4b30d58db6
@ -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;
|
||||
---
|
@ -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) => (
|
||||
<Post post={post}/>
|
||||
))
|
||||
typeof(post) === 'object') &&
|
||||
<PostEntry post={post}/>
|
||||
)
|
||||
) : (
|
||||
<p>No posts available</p>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user