"use client"; /** * Tiny event bus so any screen can open the settings dialog (which lives in * the header) without prop drilling. */ export const OPEN_SETTINGS_EVENT = "freezmo:open-settings"; export type SettingsFocus = "key"; /** `focus` scrolls the settings dialog to that field once it opens. */ export function openSettings(focus?: SettingsFocus): void { if (typeof window === "undefined") return; window.dispatchEvent(new CustomEvent(OPEN_SETTINGS_EVENT, { detail: { focus } })); }