/** * WelcomeSurface — fallback landing page. * Shown when no default surface is configured or no extensions are installed. * Checks for available extension surfaces and adjusts messaging. */ const { html } = window; const { useState, useEffect } = hooks; const { render } = preact; import { Topbar } from '../../shell/topbar.js'; function WelcomeSurface() { const BASE = window.__BASE__ || ''; const isAdmin = sw.can?.('surface.admin.access'); const [surfaces, setSurfaces] = useState([]); useEffect(() => { sw.api.get('/api/v1/surfaces').then(list => { setSurfaces((list || []).filter(s => s.route?.startsWith('/s/'))); }).catch(() => {}); }, []); const hasSurfaces = surfaces.length > 0; return html` <${Topbar} title="Armature" />
No default surface is configured. Choose a surface from the menu, or ${isAdmin ? 'set a default in admin settings.' : 'ask your administrator to set a default.'}
${isAdmin && html` Set Default Surface `} ` : html`No surfaces are installed yet. Install an extension surface to get started.
${isAdmin && html` Go to Packages `} ${!isAdmin && html`Ask your administrator to install a surface package.
`} `}