useImageGeneration
Central generation orchestration: builds query params from form snapshot + advancedOptions, calls OG image API, updates quota + SVG state.
Behavior
- Tracks
FormSnapshotin a ref to detect unchanged re-submits → opensRegenerationDialog(showRegenerationDialog) - Uses
noCacheFetchfor generation requests (/api/og-image?...) - Handles quota headers/body (
remainingGenerations), rate-limit messages viaformatRetryAfter - Supports
GenerationOverridesfor wizard one-shot submit isGenerating,error,generationOptionsstate exposed to page
Wired from page.tsx with many setter props from form/quota hooks.
Sources: src/app/card-generator/hooks/useImageGeneration.ts