import { h } from 'preact'; import Box from './components/Box'; import Events from './Events'; import Heading from './components/Heading'; import { route } from 'preact-router'; import { useContext } from 'preact/hooks'; import { ApiHost, Config } from './context'; export default function Cameras() { const config = useContext(Config); if (!config.cameras) { return

loading…

; } return (
{Object.keys(config.cameras).map((camera) => ( ))}
); } function Camera({ name }) { const apiHost = useContext(ApiHost); const href = `/cameras/${name}`; return ( {name} ); }