import { useEffect, useRef } from 'react'; export interface SEOMeta { title: string; description: string; url: string; ogImage?: string; /** Module-level constant: injected once on mount, removed on unmount. */ jsonLd?: object | object[]; /** If true, sets robots meta to "noindex, nofollow" to prevent indexing. */ noindex?: boolean; } function qs(selector: string): HTMLMetaElement | null { return document.querySelector(selector) as HTMLMetaElement | null; } /** * Updates document.title, meta description, OG/Twitter tags, and canonical * to reflect the current page. Restores originals on unmount. * * jsonLd (if provided) is injected as a