import { Link } from 'react-router-dom' import { useSite } from '../contexts/SiteContext.jsx' import { formatResetTime } from '../lib/demoNotice.js' // The public demo's strip, on every page (docs/website/DEMO_MODE.md ยง6). // Renders nothing unless GET /public/settings carries a `demo` block, which the // server sends only with DEMO_MODE on โ€” so a real shard never draws it, and the // banner needs no schedule of its own: `resetsAt` is stamped by every wipe. export default function DemoBanner() { const { settings } = useSite() const demo = settings.demo if (!demo) return null const at = demo.resetsAt ? formatResetTime(demo.resetsAt) : null const names = (demo.logins || []).map((l) => l.username) return (
Demo site {' โ€” anything you change is wiped '} {at ? `at ${at}` : 'every two hours'}. {names.length > 0 && ( <> {' Sign-ins: '} {names.join(' / ')} {' โ€” passwords on the '} sign-in page . )}
) }