import type { ReactNode } from 'react';
import { useLocalStorage } from '../hooks/useLocalStorage';
import { FontScaleCtx, DEFAULT_FONT_SCALE } from './fontScaleState';

export type { FontScaleConfig } from './fontScaleState';

export function FontScaleProvider({ children }: { children: ReactNode }) {
  const [fontScale, setFontScale] = useLocalStorage('mapFontScale', DEFAULT_FONT_SCALE);
  return <FontScaleCtx.Provider value={{ fontScale, setFontScale }}>{children}</FontScaleCtx.Provider>;
}
