import React from "react"; import Link from "next/link"; import Image from "next/image"; import { ExternalLink } from "lucide-react"; import { client, urlFor } from "@/lib/sanity"; import { Card, CardContent } from "../ui/card"; interface BlogPostcard { title: string; smallDescription: string; currentSlug: string; titleImage: string; } async function getData() { const query = `*[_type == 'blog'] | order(_createdAt desc) { title, smallDescription, "currentSlug": slug.current, titleImage }`; const data = await client.fetch(query); return data; } const BlogCards = async () => { const data: BlogPostcard[] = await getData(); console.log(data); return (
{data.map((post, idx) => (
SVRJS Blog Cover

{post.title}

{post.smallDescription}

))}
); }; export default BlogCards;