Neue Seite um Betriebe zu überwachen

This commit is contained in:
2025-11-10 17:22:26 +01:00
parent 49dec43c1e
commit 69a588e6f1
7 changed files with 458 additions and 24 deletions

View File

@@ -12,6 +12,7 @@ import useStoreSync from './hooks/useStoreSync';
import useDirtyNavigationGuard from './hooks/useDirtyNavigationGuard';
import useSessionManager from './hooks/useSessionManager';
import useAdminSettings from './hooks/useAdminSettings';
import useUserPreferences from './hooks/useUserPreferences';
import NavigationTabs from './components/NavigationTabs';
import LoginView from './components/LoginView';
import DashboardView from './components/DashboardView';
@@ -116,6 +117,17 @@ function App() {
setLoading
});
const {
preferences,
loading: preferencesLoading,
saving: locationSaving,
error: preferencesError,
updateLocation
} = useUserPreferences({
authorizedFetch,
sessionToken: session?.token
});
const {
fetchConfig,
syncStoresWithProgress,
@@ -667,6 +679,11 @@ function App() {
canDelete={Boolean(session?.isAdmin)}
focusedStoreId={focusedStoreId}
onClearFocus={() => setFocusedStoreId(null)}
userLocation={preferences?.location || null}
locationLoading={preferencesLoading}
locationSaving={locationSaving}
locationError={preferencesError}
onUpdateLocation={updateLocation}
/>
);
@@ -696,7 +713,16 @@ function App() {
<NavigationTabs isAdmin={session?.isAdmin} onProtectedNavigate={requestNavigation} />
<Routes>
<Route path="/" element={dashboardContent} />
<Route path="/store-watch" element={<StoreWatchPage authorizedFetch={authorizedFetch} knownStores={stores} />} />
<Route
path="/store-watch"
element={
<StoreWatchPage
authorizedFetch={authorizedFetch}
knownStores={stores}
userLocation={preferences?.location || null}
/>
}
/>
<Route path="/admin" element={adminPageContent} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>