// Woodbury Operator — Profile / account settings. Registers window.ProfileScreen.
(function () {
const NS = window.WoodburyPropertiesDesignSystem_7290ca;
const { Card, CardHeader, Button, Badge, Avatar, Input, Select, Checkbox, Switch, Eyebrow, Modal } = NS;
function ProfileScreen({ role, onBack }) {
const [avatar, setAvatar] = React.useState("../../assets/images/avatar-1.jpg");
const [twoFA, setTwoFA] = React.useState(true);
const [setup, setSetup] = React.useState(false);
const [code, setCode] = React.useState("");
const fileRef = React.useRef(null);
const toggle2FA = (v) => {
if (v) { setSetup(true); }
else { setTwoFA(false); window.WBToast("Two-factor authentication disabled", "danger"); }
};
const onFile = (e) => {
const f = e.target.files && e.target.files[0];
if (!f) return;
const url = URL.createObjectURL(f);
setAvatar(url);
window.WBToast("Profile photo updated");
};
return (
Back} />
{/* Identity card with photo upload */}
fileRef.current && fileRef.current.click()} title="Change photo"
style={{ position: "absolute", right: -2, bottom: -2, width: 34, height: 34, borderRadius: 9999, border: "3px solid var(--surface)", background: "var(--brand)", color: "var(--cream-50)", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }}>
Kwame Ansah
{role || "Super Administrator"}
kwame.ansah@woodbury.com
fileRef.current && fileRef.current.click()}>Upload Photo
{ setAvatar("../../assets/images/avatar-1.jpg"); window.WBToast("Photo reset"); }}>Remove
{/* Personal details */}
Cancel
window.WBToast("Profile details saved")}>Save Changes
{/* Preferences + security */}
{/* 2FA setup modal */}
setSetup(false)} icon="shield-check" title="Set up Two-Factor Authentication" subtitle="Scan the code with your authenticator app, then verify." width={460}
footer={ setSetup(false)}>Cancel { setSetup(false); setTwoFA(true); window.WBToast("Two-factor authentication enabled"); }}>Enable 2FA }>
{Array.from({ length: 121 }).map((_, i) => { const r = ((i * 73 + 17) % 100) < 46 || i % 12 === 0; return ; })}
Or enter this key manually
WBRY-4F8K-2ACR-91GH
);
}
window.ProfileScreen = ProfileScreen;
})();