import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import DashboardLayout from '../layout/DashboardLayout'; import { useDashboardScaffold } from '../hooks/useDashboardScaffold'; import { SectionCard } from '../components/SectionCard'; import PrimaryButton from '../components/PrimaryButton'; type ToggleGroup = Record; type SecurityToggle = 'twoFactor' | 'deviceApprovals' | 'sessionTimeout'; type NotificationToggle = 'email' | 'sms' | 'whatsapp' | 'slack'; type WorkspacePreference = { timezone: string; language: string; weekStartsOn: string; }; const SettingsPage: React.FC = () => { const { topBarProps } = useDashboardScaffold(); const { t } = useTranslation(); const [security, setSecurity] = useState>({ twoFactor: true, deviceApprovals: true, sessionTimeout: false, }); const [notifications, setNotifications] = useState>({ email: true, sms: false, whatsapp: true, slack: true, }); const [workspace, setWorkspace] = useState({ timezone: 'Asia/Kolkata (IST)', language: 'English', weekStartsOn: 'Monday', }); const toggleSecurity = (key: SecurityToggle) => { setSecurity((prev) => ({ ...prev, [key]: !prev[key] })); }; const toggleNotification = (key: NotificationToggle) => { setNotifications((prev) => ({ ...prev, [key]: !prev[key] })); }; const handleWorkspaceChange = (field: keyof WorkspacePreference) => (event: React.ChangeEvent) => { setWorkspace((prev) => ({ ...prev, [field]: event.target.value })); }; return (

{t('settings.workspace_settings')}

{t('settings.workspace_settings_desc')}

{( [ { key: 'twoFactor' as SecurityToggle, label: 'Two-factor authentication', description: 'Require OTP or authenticator approval on every new login.', }, { key: 'deviceApprovals' as SecurityToggle, label: 'Device approvals', description: 'Concierge pings admins when a new laptop or phone signs in.', }, { key: 'sessionTimeout' as SecurityToggle, label: '90 minute session timeout', description: 'Auto-sign out idle consoles to protect sensitive briefs.', }, ] ).map((item) => (

{item.label}

{item.description}

))}

Admin alerting

Pennyzo will escalate high-risk sign-ins to {security.deviceApprovals ? 'leadership Slack' : 'email only'} and include geo-location snapshots.

{( [ { key: 'email' as NotificationToggle, label: 'Email digests', description: 'Daily summary of agent runs, documents prepared, and credit snapshots.', }, { key: 'sms' as NotificationToggle, label: 'SMS nudges', description: 'Instant message when concierge requires leadership approval.', }, { key: 'whatsapp' as NotificationToggle, label: 'WhatsApp alerts', description: 'Pipeline wins and budget approvals piped to the CXO group.', }, { key: 'slack' as NotificationToggle, label: 'Slack channel updates', description: 'Live feed in #pennyzo-warroom of agent completions and credit usage.', }, ] ).map((item) => (

{item.label}

{item.description}

))}

Escalation window

Escalate to leadership if concierge waits more than 4 hours for approvals.

Preferred export format
{['CSV', 'Excel', 'Google Sheets'].map((option) => ( ))}
{[{ name: 'Slack', status: 'Live', description: 'Real-time agent completions in #pennyzo-warroom channel.', }, { name: 'HubSpot', status: 'Live', description: 'Sync CRM deals to concierge for follow-up summaries.', }, { name: 'Google Drive', status: 'Pending approval', description: 'Route auto-prepped decks to investor-ready folders.', }, { name: 'SAP SuccessFactors', status: 'Live', description: 'Push payroll exports and compliance letters on schedule.', }].map((integration) => (

{integration.name}

{integration.status}

{integration.description}

))}
); }; export default SettingsPage;