<!-- source-hash: ef127df882f0312f1636164b044502e4 -->
Thin client-side React hook that generates a branded OG placeholder image URL by delegating to a caller-supplied URL builder, keeping the lib layer free of hub-specific dependencies.

## Key Components

### `useOgPlaceholder`
A memoized hook that wraps any `buildUrl` function to conditionally produce a placeholder image URL.

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `buildUrl` | `(title, options) => string` | — | URL builder function (e.g. `buildOgPlaceholderUrl` from `lib/utils/entity-image.ts`) |
| `title` | `string \| undefined \| null` | — | Text displayed on the placeholder image |
| `siteName` | `string` | `''` | Optional site name shown below the title |
| `enabled` | `boolean` | `true` | Gates URL generation; returns `null` when `false` |
| `aspect` | `'wide' \| 'square'` | `'wide'` | `'wide'` = 1200×630 social card; `'square'` = 1024×1024 for compact chat-inline slots |

**Returns:** `string | null` — the generated URL, or `null` if disabled or `title` is falsy.

## Usage Example

```typescript
import { useOgPlaceholder } from './use-og-placeholder'
import { buildOgPlaceholderUrl } from 'lib/utils/entity-image'

function ArticleCard({ title, site }: { title: string; site: string }) {
  // Wide social-card placeholder (default)
  const placeholderUrl = useOgPlaceholder(
    buildOgPlaceholderUrl,
    title,
    site,
  )

  // Square placeholder for compact chat-inline card slots
  const squarePlaceholder = useOgPlaceholder(
    buildOgPlaceholderUrl,
    title,
    site,
    true,
    'square',
  )

  return (
    <img
      src={placeholderUrl ?? '/fallback.png'}
      alt={title}
    />
  )
}
```

> **Architecture note:** The hook is intentionally a thin client wrapper — the URL-building logic lives in `lib/utils/entity-image.ts` and is injected via `buildUrl`, so embedded apps can substitute their own `/api/og-placeholder` route without pulling in hub dependencies.