29 lines
993 B
TypeScript
29 lines
993 B
TypeScript
/**
|
|
* /u/[handle] — public profile, Posts tab (default).
|
|
*
|
|
* Server shell that exists for two reasons:
|
|
*
|
|
* 1. Export `generateMetadata` so direct shares of this URL
|
|
* (https://prabhupadasays.org/u/<handle>) get a rich OG card
|
|
* pointing at /api/og/profile/<handle>. The layout and the body
|
|
* below are client components; only this file is server.
|
|
* 2. Mount the client tree (<PostsGrid />), which reads the
|
|
* ProfileContext provided by the parent layout for the post-grid
|
|
* hrefs and renders the feed.
|
|
*/
|
|
|
|
import type { Metadata } from "next";
|
|
import { PostsGrid } from "./posts-grid";
|
|
import { metadataForHandle } from "./profile-og";
|
|
|
|
type Props = { params: Promise<{ handle: string }> };
|
|
|
|
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
const { handle } = await params;
|
|
return metadataForHandle(handle);
|
|
}
|
|
|
|
export default function PublicProfilePage({ params }: Props) {
|
|
return <PostsGrid params={params} />;
|
|
}
|