feat: add policy pages

This commit is contained in:
gosangam
2026-06-02 01:57:08 +05:30
parent 0352cb2003
commit 91d5d272d2
168 changed files with 1326 additions and 81 deletions
+19
View File
@@ -0,0 +1,19 @@
"use client";
import { createContext, useContext } from "react";
import type { PublicProfile } from "@/lib/social";
/** Set by the /u/[handle] layout after it fetches the profile. Child
* pages read it to render content (e.g. the Collections tab needs the
* profile's `public_collections` array) without a second fetch. */
export const PublicProfileContext = createContext<PublicProfile | null>(null);
export function usePublicProfile(): PublicProfile {
const v = useContext(PublicProfileContext);
if (!v) {
throw new Error(
"usePublicProfile must be used inside the /u/[handle] layout",
);
}
return v;
}