import { useEffect, useState } from 'react'; import { faBuilding, faStethoscope, faUserTie, faPhone, faRobot, faGlobe, faPalette, faShieldHalved, } from '@fortawesome/pro-duotone-svg-icons'; import { TopBar } from '@/components/layout/top-bar'; import { SectionCard } from '@/components/setup/section-card'; import { SETUP_STEP_NAMES, SETUP_STEP_LABELS, type SetupState, type SetupStepName, getSetupState, } from '@/lib/setup-state'; // Settings hub — the new /settings route. Replaces the old monolithic // SettingsPage which had only the team listing. The team listing now lives // at /settings/team via TeamSettingsPage. // // Each card links to a dedicated settings page. Pages built in earlier // phases link to existing routes (branding, rules); pages coming in later // phases link to placeholder routes that render "Coming soon" until those // phases land. // // The completion status badges mirror the sidecar setup-state so an admin // returning later sees what still needs attention. Sections without a // matching wizard step (branding, widget, rules) don't show a badge. const STEP_TO_STATUS = (state: SetupState | null, step: SetupStepName | null) => { if (!state || !step) return 'unknown' as const; return state.steps[step].completed ? ('complete' as const) : ('incomplete' as const); }; export const SettingsPage = () => { const [state, setState] = useState(null); useEffect(() => { getSetupState() .then(setState) .catch(() => { // Hub still works even if setup-state isn't reachable — just no badges. }); }, []); return (
{/* Identity & branding */} {/* Care delivery */} {/* Channels & automation */} {state && (

{SETUP_STEP_NAMES.filter(s => state.steps[s].completed).length} of{' '} {SETUP_STEP_NAMES.length} setup steps complete.

)}
); }; const SectionGroup = ({ title, description, children, }: { title: string; description: string; children: React.ReactNode; }) => { return (

{title}

{description}

{children}
); };