import { BLOG_POSTS } from "@/content/blog";
import { ogImage, OG_SIZE } from "@/lib/og";

export const alt = "Quto AI Blog — Voice AI guides & engineering";
export const size = OG_SIZE;
export const contentType = "image/png";

// Title = the post's own title, eyebrow = its category (same data the page's
// metadata uses); falls back to the blog name for unknown slugs.
export default async function Image({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  const post = BLOG_POSTS.find((p) => p.slug === slug);
  const title = post ? post.title : "Quto AI Blog";
  const eyebrow = post ? post.category : undefined;
  return ogImage({ title, eyebrow });
}
