"use client"; import { useEffect } from "react"; /** * Shared destination readiness hook. * * Call this from final destination client components to signal that the page UI * is ready and Flutter can remove its native loading cover. * * This hook only **requests** readiness — it does not directly interact with * the Flutter bridge. The root bootstrap script in layout.tsx owns actual * delivery and handles the case where HabibApp is injected late. * * @param ready - Whether the page considers itself visually ready. * Pass `true` once critical data is available or the fallback * UI is showing. The signal fires at most once per mount. */ export function useHabibWebReady(ready: boolean) { useEffect(() => { if (ready && typeof window !== "undefined") { window.__announceHabibWebReady?.(); } }, [ready]); }