import { ref, watch } from 'vue' const STORAGE_KEY = 'ruwio:tooltipsEnabled' function readInitial(): boolean { try { return localStorage.getItem(STORAGE_KEY) !== '0' } catch { return true } } const enabled = ref(readInitial()) watch(enabled, (v) => { try { localStorage.setItem(STORAGE_KEY, v ? '1' : '0') } catch { /* storage disabled — no persistence, behavior stays in-memory */ } }) export function useTooltipPref() { return { enabled } }