Files
react-website/src/main.tsx
T
MehboobKandClaude Sonnet 5 7024269bf6 Add family safe-zone location demo, wire into Mobile SDK demo slider
Cinematic 30s player showing safe-zone creation and leave-zone alerts,
matching the existing threat-demo pattern. Added as a 6th rotating
slide in ThreatDemosSlider (live on /mobile-sdk and /threat-demos),
plus a standalone /location-demo route for recording.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 19:06:53 +05:00

70 lines
3.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React, { Suspense } from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter, Routes, Route, useParams } from 'react-router-dom'
import { ContentProvider } from './cms/store'
import { PAGES } from './cms/pages'
// Lazy-loaded so each area's CSS stays isolated:
// the site's global stylesheet only loads on site routes, never on the demo pages.
const SiteApp = React.lazy(() => import('./site/SiteApp'))
const DemoScreen = React.lazy(() => import('./demo/DemoScreen'))
const DemoVideoPage = React.lazy(() => import('./demo/DemoVideoPage'))
const ThreatDemosSlider = React.lazy(() => import('./demo/threats/ThreatDemosSlider'))
const ThreatDemoPlayerPage = React.lazy(() => import('./demo/threats/ThreatDemoPlayerPage'))
const LocationDemo = React.lazy(() => import('./demo/location/LocationDemo'))
const AdminApp = React.lazy(() => import('./cms/admin/AdminApp'))
function ArticleRoute() {
const { slug } = useParams()
return <SiteApp articleSlug={slug} />
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<BrowserRouter>
<Suspense fallback={<div style={{ minHeight: '100vh', background: '#013B49' }} />}>
<Routes>
{/* Threat-detection demo slider + per-scenario players */}
<Route path="/threat-demos" element={<ThreatDemosSlider />} />
<Route path="/threat-demo/:id" element={<ThreatDemoPlayerPage />} />
{/* Location / geofencing demo — safe-zone creation + leave-zone alert */}
<Route path="/location-demo" element={<LocationDemo />} />
{/* Cinematic product video — its own page */}
<Route path="/demo-video" element={<DemoVideoPage />} />
{/* Full interactive demo player (Flows A–D, ?mode=video) */}
<Route path="/demo" element={<DemoScreen />} />
{/* The CMS. Content is fetched inside, so it sits outside ContentProvider. */}
<Route
path="/admin/*"
element={
<Suspense fallback={<div style={{ minHeight: '100vh', background: '#0b1418' }} />}>
<AdminApp />
</Suspense>
}
/>
{/* The marketing site: one real URL per page, plus one per article. */}
<Route
path="*"
element={
<ContentProvider>
<Routes>
{PAGES.map((page) => (
<Route key={page.id} path={page.path} element={<SiteApp pageId={page.id} />} />
))}
<Route path="/blog/:slug" element={<ArticleRoute />} />
{/* Legacy hash-era and mistyped URLs still land on a working page. */}
<Route path="/blog" element={<SiteApp pageId="p7" />} />
<Route path="/blog.html" element={<SiteApp pageId="p7" />} />
<Route path="*" element={<SiteApp notFound />} />
</Routes>
</ContentProvider>
}
/>
</Routes>
</Suspense>
</BrowserRouter>
</React.StrictMode>,
)