React hook that resolves a branded OG placeholder image URL by reading runtime endpoints from `ChatRuntime` context and delegating to `buildOgPlaceholderUrl`. ## Key Components ### `UseOgPlaceholderUrlArgs` Configuration interface for the hook: | Property | Type | Default | Description | |---|---|---|---| | `title` | `string \| undefined \| null` | — | Text displayed on the placeholder image | | `siteName` | `string` | `''` | Site name shown below the title | | `aspect` | `'wide' \| 'square'` | `'wide'` | `'wide'` = 1200×630 social card; `'square'` = 1024×1024 for compact chat-inline slots | | `enabled` | `boolean` | `true` | When `false`, returns `null` instead of a URL | ### `useOgPlaceholderUrl` The single canonical hook for OG placeholder resolution. Reads `endpoints` from `ChatRuntime` context and passes them to `buildOgPlaceholderUrl`, which resolves the route base via: 1. Explicit `ogPlaceholderUrl` endpoint 2. Derived from `imageProxyUrlPrefix` 3. Same-origin fallback `/api/og-placeholder` Returns a memoized `string | null`. Per-platform brand colors are resolved server-side by the route handler — nothing is baked into the URL. ## Usage Example ```typescript import { useOgPlaceholderUrl } from './use-og-placeholder-url' function LinkCard({ title, siteName }: { title: string; siteName: string }) { // Wide social-card placeholder (default) const placeholderUrl = useOgPlaceholderUrl({ title, siteName }) // Square variant for compact chat-inline slots const squarePlaceholderUrl = useOgPlaceholderUrl({ title, siteName, aspect: 'square', }) // Conditionally disabled — returns null when no title is available const conditionalUrl = useOgPlaceholderUrl({ title, enabled: Boolean(title), }) return {title} } ``` ## Notes - Replaces the older builder-injection pattern `useOgPlaceholder(buildUrl, …)` — callers no longer supply a URL builder. - `useEntityCardPlaceholder` delegates here, ensuring all surfaces share one memo and one code path. - Safe to call with a nullish `title`; returns `null` without throwing. **Source:** [`use-og-placeholder-url.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/use-og-placeholder-url.ts)