/* Willow Creek Portal — login screen + app shell (role switch, demo store). */ const { PIcon: LIcon, loadStore, saveStore } = window.WCPortal; const { useState: lUseState, useEffect: lUseEffect } = React; function LoginScreen({ onLogin }) { const { Card, Button, Input, Checkbox, Badge } = window.WillowCreekDesignSystem_90378c; const [role, setRole] = lUseState("resident"); const [email, setEmail] = lUseState(""); const [pw, setPw] = lUseState(""); const [busy, setBusy] = lUseState(false); const submit = () => { setBusy(true); setTimeout(() => { setBusy(false); onLogin(role); }, 700); }; return (
{/* Brand panel */}
Willow Creek Sober Living

One honest day at a time.

Pay your program fee, sign house paperwork, and see where you stand — all in one calm place.

Private & confidential
{/* Form panel */}

Sign in

Welcome back. We're glad you're here.

{/* Role toggle */}
{[["resident", "user", "Resident"], ["manager", "key-round", "Manager"], ["admin", "shield", "Admin"]].map(([id, icon, label]) => ( ))}
setEmail(e.target.value)} placeholder={role === "resident" ? "marcus@email.com" : role === "manager" ? "james@willowcreeksober.org" : "rebecca@willowcreeksober.org"} leftIcon={} /> setPw(e.target.value)} placeholder="••••••••" leftIcon={} /> {role === "manager" && (

House managers get minimum admin access: approvals, houses & beds, residents, and payments — no forms builder or rates/site settings.

)}
Demo login — any email and password works. Pick a role above and sign in to explore.

New to Willow Creek? Apply on our website

); } /* ---- App shell ---- */ function PortalApp() { const [session, setSession] = lUseState(() => { try { return localStorage.getItem("wc_portal_session") || null; } catch (e) { return null; } }); const [store, setStoreState] = lUseState(loadStore); const setStore = (updater) => { setStoreState((prev) => { const next = typeof updater === "function" ? updater(prev) : updater; saveStore(next); return next; }); }; const login = (role) => { setSession(role); try { localStorage.setItem("wc_portal_session", role); } catch (e) {} }; const logout = () => { setSession(null); try { localStorage.removeItem("wc_portal_session"); } catch (e) {} }; if (!session) return ; if (session === "admin") return ; if (session === "manager") return ; return ; } ReactDOM.createRoot(document.getElementById("app")).render();