// Settings.jsx — Admin settings page function SettingsPage() { const [tab, setTab] = React.useState('company'); const [savedTab, setSavedTab] = React.useState(null); const tabs = [ { id: 'company', label: 'Company', icon: 'Briefcase' }, { id: 'pricing', label: 'Pricing & Surcharges', icon: 'DollarSign' }, { id: 'integrations', label: 'Integrations', icon: 'Settings' }, { id: 'security', label: 'Security', icon: 'Shield' }, ]; const flagSaved = (k) => { setSavedTab(k); setTimeout(() => setSavedTab(null), 1800); }; return (
{tabs.map(t => { const Ico = window[t.icon]; return ( ); })}
{tab === 'company' ? (
Company Profile
{savedTab === 'company' ? Saved : null}
) : null} {tab === 'pricing' ? (
Pricing & Diesel Surcharge
Changes apply only to new work orders. Existing quotes keep their current pricing.
{savedTab === 'pricing' ? Saved : null}
) : null} {tab === 'integrations' ? (
{[ { name: 'AutoCount Accounting', status: 'Connected', desc: 'Field mapping configured · last sync 14 min ago', color: 'green' }, { name: 'WhatsApp Business API', status: 'Connected', desc: 'Sender +60 12-555 0000 · 2,140 msgs this month', color: 'green' }, { name: 'Web Push Notifications', status: 'Connected', desc: 'VAPID keys configured · 18 active subscriptions', color: 'green' }, { name: 'Cloudflare Turnstile', status: 'Connected', desc: 'Bot protection on login · 0 challenges failed today', color: 'green' }, { name: 'Google Workspace SSO', status: 'Not Connected', desc: 'Optional — sign in with @powleecrane.com Google accounts', color: 'gray' }, { name: 'SMS Gateway (Maxis)', status: 'Not Connected', desc: 'Optional — fallback if WhatsApp fails', color: 'gray' }, ].map(i => (
{i.name}
{i.desc}
{i.status}
))}
) : null} {tab === 'security' ? (
Security & Sessions
{savedTab === 'security' ? Saved : null}
) : null}
); } Object.assign(window, { SettingsPage });