Files
buzz-sheet/app/[character]/opengraph-image.tsx
T
gunshiz 737b54bff8
CI / Verify (push) Successful in 1m12s
CI / Build immutable images and deploy (push) Successful in 1m17s
feat: normalize catalog tables and current character assets
2026-08-31 22:46:06 +07:00

29 lines
818 B
TypeScript

import { connection } from "next/server";
import { getCachedPublicGuide } from "@/lib/cache/public";
import {
generateOgImage,
ogImageContentType,
ogImageSize,
} from "@/lib/og-image";
export const alt = "Buzz Guide character guide";
export const size = ogImageSize;
export const contentType = ogImageContentType;
export default async function Image({
params,
}: {
params: Promise<{ character: string }>;
}) {
await connection();
const guide = await getCachedPublicGuide((await params).character);
if (!guide) return new Response("Not found", { status: 404 });
return generateOgImage({
title: guide.name,
sub: guide.overview,
characterCard: true,
backgroundUrl: guide.character.nameCardImageUrl,
characterUrl: guide.character.splashImageUrl ?? guide.character.imageUrl,
});
}