import { getTheme, setTheme, toggleTheme, onThemeChange, THEMES } from './theme.js';
import { themeIcon } from './screens/icons.js';
import { escapeHtml } from './util.js';
import { attachTooltips } from './tooltip.js';
const HOLD_MS = 450;
// Every screen showed a theme button advertising "Hold for more themes" in
// its tooltip, but only the main menu actually wired up the hold gesture --
// everywhere else it was a plain click-only toggle, so the tooltip was
// lying. One shared implementation instead of six copies of the same
// click/hold/popover logic, so the behavior can't drift out of sync again.
export function renderThemeButton(root) {
const wrap = document.createElement('div');
wrap.className = 'theme-control';
wrap.innerHTML = `