import { h, Fragment } from 'preact'; import LinkedLogo from './components/LinkedLogo'; import { Match } from 'preact-router/match'; import { memo } from 'preact/compat'; import { ENV } from './env'; import useSWR from 'swr'; import { useMemo } from 'preact/hooks'; import NavigationDrawer, { Destination, Separator } from './components/NavigationDrawer'; export default function Sidebar() { const { data: config } = useSWR('config'); const cameras = useMemo(() => Object.entries(config.cameras), [config]); const { birdseye } = config; return ( }> {({ matches }) => matches ? ( {cameras.map(([camera]) => ( ))} ) : null } {({ matches }) => matches ? ( {cameras.map(([camera, conf]) => { if (conf.record.enabled) { return ( ); } return null; })} ) : null } {birdseye?.enabled ? : null}
{ENV !== 'production' ? ( ) : null} ); } const Header = memo(() => { return (
); });