mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
13 lines
524 B
JavaScript
13 lines
524 B
JavaScript
// Hook: useHudMapSetting
|
|
// Purpose: Reads and persists HUD map visibility/preferences via settings namespaces. Scope: Exposes a small stateful API for map toggle interactions.
|
|
import { useSettingsNamespace } from '../settings/index.js';
|
|
|
|
export function useHudMapSetting() {
|
|
const { value, save } = useSettingsNamespace('page', { hudMapDesktop: false });
|
|
const enabled = Boolean(value?.hudMapDesktop);
|
|
const setEnabled = (next) => {
|
|
save({ hudMapDesktop: Boolean(next) });
|
|
};
|
|
return [enabled, setEnabled];
|
|
}
|