import { Button, Card, CardActions, CardContent, CardMedia, Chip, Stack, Typography } from "@mui/material"; import { client } from "@/sanity/lib/client"; import Image from "next/image"; import Link from "next/link"; export default async function PostList() { const posts = await client.fetch(`*[_type == "post"] { title, description, slug, author, publishedAt, mainImage { asset -> { _id, url }, alt }, "categories": categories[]->title, "author_name": author->name, "author_image": author->image }`); return ( posts.map((post) => ( { post.mainImage && {post.mainImage.alt} } {post.title} {post.categories.map((category: string, idx: number) => )} {post.description ? post.description : "No description yet."} )) ); }