24 lines
478 B
TypeScript
24 lines
478 B
TypeScript
|
import { Metadata } from "next";
|
||
|
|
||
|
type Fallback = {
|
||
|
title: string;
|
||
|
description: string;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Generates metadata for a fallback embed.
|
||
|
*
|
||
|
* @param title the title of the embed
|
||
|
* @param description the description of the embed
|
||
|
* @returns the metadata for the embed
|
||
|
*/
|
||
|
export function embedFallback({ title, description }: Fallback): Metadata {
|
||
|
return {
|
||
|
title: `${title}`,
|
||
|
openGraph: {
|
||
|
title: `${title}`,
|
||
|
description: description,
|
||
|
},
|
||
|
};
|
||
|
}
|