mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
The edge answers every path under /apps with its one page (lib/edge.ts `APP`, `ROOTS`, `DATA`), the page signs a stranger in to the address and draws the app for a member, and hosted.spec.ts holds who sees what: a member holding beta.crm alone has CRM and its live host in the pane, staff and a SuperAdmin have all five, a reader the switch is off for has the request path, a stranger is sent to sign in and back, a phone has the apps as rows. Needs @hanzo/app >= 0.2.38 (lib/hosted). Claude-Session: https://claude.ai/code/session_017vrVus6PPBgP5YRzKV1iqW
34 lines
967 B
TypeScript
34 lines
967 B
TypeScript
'use client'
|
|
|
|
// /apps, and by the edge every path under it (lib/edge.ts `APP`): the apps in
|
|
// beta that draw inside the app (@hanzo/app lib/hosted), /apps/<id> each. Every
|
|
// address here is a place in the app, so a stranger signs in to reach it
|
|
// (destination.ts `enter`, through `Apex`) and comes back to it; a signed-in
|
|
// reader is drawn the app, whose pane frames the app's own live host.
|
|
|
|
import type { ReactNode } from 'react'
|
|
import dynamic from 'next/dynamic'
|
|
import { Room } from '@/components/app'
|
|
import { Apex } from '../_apex'
|
|
|
|
/** The app, fetched only for a signed-in reader. */
|
|
const App = dynamic(() => import('../_web'), { ssr: false })
|
|
|
|
/** No address under /apps is a page for a stranger. */
|
|
const placed = (): boolean => true
|
|
|
|
export function Door({ children }: { children: ReactNode }) {
|
|
return (
|
|
<Apex
|
|
placed={placed}
|
|
app={
|
|
<Room>
|
|
<App />
|
|
</Room>
|
|
}
|
|
>
|
|
{children}
|
|
</Apex>
|
|
)
|
|
}
|