import Head from 'next/head'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import styles from '../styles/Home.module.css'; import ActiveRegion from '../components/ActiveRegion'; import { devTools } from '../../../build/module'; export default function Home() { const router = useRouter(); const isPreview = router.query.renderMode === 'preview'; const [isDevToolsEnabled, setIsDevToolsEnabled] = useState(false); const [numActiveRegions, setNumActiveRegion] = useState(1); useEffect(() => { if (devTools.isEnabled()) { setIsDevToolsEnabled(true); // Run this in the developer console to set the active region: // devTools.sendMessage('worker-state', { name: 'perchview', state: { activeRegion: 'top-right' } }) (window as any).devTools = devTools; } }, []); return (
Create Next App
{isPreview &&

Preview Mode

} {/* Testing a list of subscriptions */}
  {isDevToolsEnabled && ( <>         )}
{Array.from({ length: numActiveRegions }, (_, i) => ( ))}
); }