import { AUTHORS_DATA } from "@/lib/authors-data";
import { ogImage, OG_SIZE } from "@/lib/og";

export const alt = "Quto AI author";
export const size = OG_SIZE;
export const contentType = "image/png";

// Title = author name, eyebrow = author role (same data the page's metadata
// uses); falls back to the brand name for unknown slugs.
export default async function Image({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  const author = AUTHORS_DATA.find((a) => a.slug === slug);
  const title = author ? author.name : "Quto AI";
  const eyebrow = author ? author.role : undefined;
  return ogImage({ title, eyebrow });
}
