import * as Routes from './routes'; import { h } from 'preact'; import ActivityIndicator from './components/ActivityIndicator'; import AsyncRoute from 'preact-async-route'; import AppBar from './AppBar'; import Cameras from './routes/Cameras'; import { Router } from 'preact-router'; import Sidebar from './Sidebar'; import { DarkModeProvider, DrawerProvider } from './context'; import { FetchStatus, useConfig } from './api'; export default function App() { const { status, data: config } = useConfig(); const cameraComponent = config && config.ui.use_experimental ? Routes.getCameraV2 : Routes.getCamera; return (
{status !== FetchStatus.LOADED ? (
) : (
)}
); }