import { client, urlFor } from "@/lib/sanity"; import { PortableText } from "@portabletext/react"; import Image from "next/image"; import Link from "next/link"; import { ArrowLeft } from "lucide-react"; import { Separator } from "@/components/ui/separator"; async function getData(slug: string) { const query = ` *[_type == "blog" && slug.current == '${slug}'] { "currentSlug": slug.current, title, content, titleImage }[0]`; const data = await client.fetch(query); return data; } interface BlogSlugArticle { currentSlug: string; title: string; content: any; titleImage: string; } export default async function BlogSlugArticle({ params, }: { params: { slug: string }; }) { const data: BlogSlugArticle = await getData(params.slug); return (
Back to Blog
{data.titleImage && (

{data.title}

{data.title}
)}
); }