Shreyaschorge 0d43b35c28
Revert "Merge pull request #15 from neynarxyz/shreyas-formatting"
This reverts commit b1fdfc19a92241638692d58494f48ce1bb25df74, reversing
changes made to b9e2087bd8cd9e8ed7a5862936609b5bf29aa911.
2025-07-16 17:21:12 +05:30

35 lines
1.0 KiB
TypeScript

import type { Metadata } from "next";
import { redirect } from "next/navigation";
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
import { getMiniAppEmbedMetadata } from "~/lib/utils";
export const revalidate = 300;
// This is an example of how to generate a dynamically generated share page based on fid:
// Sharing this route e.g. exmaple.com/share/123 will generate a share page for fid 123,
// with the image dynamically generated by the opengraph-image API route.
export async function generateMetadata({
params,
}: {
params: Promise<{ fid: string }>;
}): Promise<Metadata> {
const { fid } = await params;
const imageUrl = `${APP_URL}/api/opengraph-image?fid=${fid}`;
return {
title: `${APP_NAME} - Share`,
openGraph: {
title: APP_NAME,
description: APP_DESCRIPTION,
images: [imageUrl],
},
other: {
"fc:frame": JSON.stringify(getMiniAppEmbedMetadata(imageUrl)),
},
};
}
export default function SharePage() {
// redirect to home page
redirect("/");
}