1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* eslint-disable react-refresh/only-export-components */
import { type ReactNode } from "react";
import { type RegionId } from "./config/RegionConfig";
import { MapProvider, useMap } from "./contexts/MapContext";
import {
SettingsProvider,
useSettings,
type MapPositionMode,
type TableStyle,
type Theme,
} from "./contexts/SettingsContext";
// Re-export types for compatibility
export type { MapPositionMode, RegionId, TableStyle, Theme };
// Combined hook for backward compatibility
export const useApp = () => {
const settings = useSettings();
const map = useMap();
return {
...settings,
...map,
// Mock region support for now since we only have one region
region: "vigo" as RegionId,
setRegion: (region: RegionId) => { console.log("Set region", region); },
};
};
// Wrapper provider
export const AppProvider = ({ children }: { children: ReactNode }) => {
return (
<SettingsProvider>
<MapProvider>{children}</MapProvider>
</SettingsProvider>
);
};
|