next-banner
Version:
Generate Open Graph images for Next.js on build
18 lines (15 loc) • 401 B
text/typescript
import { DEFAULT_LAYOUT } from "../constants";
import { Custom } from "../types";
interface BannerProps {
layout?: string;
custom?: Custom;
}
export default function setBannerData({ layout, custom }: BannerProps): void {
if (typeof globalThis !== "undefined") {
globalThis.NextBannerData = {
layout: layout ?? DEFAULT_LAYOUT,
meta: {},
custom: custom ?? {},
};
}
}