// Atlas · Settings modal const { useState: useStgState, useEffect: useStgEffect } = React; const TABS = ["Profile", "Appearance", "Preferences", "Account"]; function SettingsModal({ user, onClose, onSave, theme, setTheme }) { const [tab, setTab] = useStgState("Profile"); const [saving, setSaving] = useStgState(false); const [saved, setSaved] = useStgState(false); const profile = user?.profile || {}; const [form, setForm] = useStgState({ name: user?.name || "", title: profile.title || "", company: profile.company || "", department: profile.department || "", companySize: profile.companySize || "", useCase: profile.useCase || "", defaultReportType: profile.defaultReportType || "tech", defaultFormat: profile.defaultFormat || "pdf", defaultAudience: profile.defaultAudience || "Internal R&D / science team", emailNotifications: profile.emailNotifications !== false, digestFrequency: profile.digestFrequency || "weekly", }); const set = (k, v) => setForm((f) => ({ ...f, [k]: v })); const handleSave = async () => { setSaving(true); try { await fetch("/api/profile", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(form), }); setSaved(true); setTimeout(() => setSaved(false), 2000); onSave && onSave(form); } catch (e) { alert("Could not save: " + e.message); } finally { setSaving(false); } }; // Close on Escape useStgEffect(() => { const handler = (e) => { if (e.key === "Escape") onClose(); }; window.addEventListener("keydown", handler); return () => window.removeEventListener("keydown", handler); }, []); const COMPANY_SIZES = ["1–10", "11–50", "51–200", "201–1,000", "1,000+"]; const USE_CASES = ["Academic / university research", "Biotech / pharma R&D", "Corporate strategy & BD", "Investment / VC due diligence", "Market intelligence", "Consulting", "Other"]; return (
{ if (e.target === e.currentTarget) onClose(); }}>

Settings

{TABS.map((t) => ( ))}
{/* ── Profile ── */} {tab === "Profile" && ( <>
Personal information
Full name
Shown in reports and the workspace.
set("name", e.target.value)} />
Job title
set("title", e.target.value)} placeholder="e.g. VP of R&D" />
Company
set("company", e.target.value)} placeholder="e.g. Acme Bio" />
Department
set("department", e.target.value)} placeholder="e.g. Business Development" />
Company size
Primary use case
Login
Email
{user?.email}
Google
)} {/* ── Appearance ── */} {tab === "Appearance" && ( <>
Theme
Color mode
Choose how Atlas looks for you.
{["light", "dark"].map((t) => ( ))}
Preview
Atlas
)} {/* ── Preferences ── */} {tab === "Preferences" && ( <>
Notifications
Email notifications
Get notified when a report completes.
Report digest
Receive a summary of your recent reports by email.
)} {/* ── Account ── */} {tab === "Account" && ( <>
Plan
Current plan
Atlas Enterprise
Active
Reports this month
Usage resets on the 1st.
Billing
Billing contact
Managed by your Atlas account team.
Contact us
Danger zone
Sign out everywhere
Clears all active sessions.
Sign out
)}
); } window.SettingsModal = SettingsModal;