Provides the client-side hook and fetch helper for loading per-platform chat empty-state configuration (greeting, quick-action chips, RAG table IDs) in both host (SSR props) and cross-origin embed (REST fetch) scenarios. ## Key Components ### Interfaces | Interface | Purpose | |---|---| | `EmptyStateQuickAction` | A single quick-action chip — `id`, `label`, `prompt`, plus optional icon (glyph name, URL, or props) | | `EmptyStateIcon` | Agent identity icon resolved by `` on the empty state | | `EmptyStateConfig` | Wire shape of `GET /api/docs/empty-state`; fields: `name`, `icon`, `greeting`, `enabledRagTableIds`, `quickActions`, `suggestedQueries` | ### Functions - **`fetchEmptyStateConfig(signal, emptyStateUrl)`** — Bare GET via `embedAuthedFetch`. Returns `EMPTY_STATE_FALLBACK` on any non-2xx; logs 5xx errors without surfacing toasts; re-throws `AbortError` for react-query cancellation. - **`useEmptyStateConfig(emptyStateUrl, options?)`** — React hook wrapping the fetch in a react-query query. Keyed on `emptyStateUrl`; `staleTime`/`gcTime: Infinity` makes the result static per session. `enabled: false` skips the network call entirely and returns the fallback immediately. ## Usage Example ```typescript // Embed mode — fetch config from the host's empty-state endpoint const { config, loading, loaded } = useEmptyStateConfig( runtime.endpoints.emptyStateUrl, { enabled: true }, ); if (loaded) { console.log(config.greeting); // Admin-edited greeting or null console.log(config.quickActions); // EmptyStateQuickAction[] console.log(config.enabledRagTableIds); // string[] } // Host mode — URL is undefined; skip the fetch, use SSR props instead const { config } = useEmptyStateConfig(undefined, { enabled: false }); // config === EMPTY_STATE_FALLBACK, loaded === true immediately ``` > **Note:** Pass `enabled: false` in host (SSR) mode where `emptyStateUrl` is unset. The hook will never fire a network request and `loaded` will be `true` immediately, so downstream components can unconditionally read `config` without a loading guard.