diff --git a/app/settings/SettingsPageClient.tsx b/app/settings/SettingsPageClient.tsx index 901d138..6279c07 100644 --- a/app/settings/SettingsPageClient.tsx +++ b/app/settings/SettingsPageClient.tsx @@ -1,15 +1,30 @@ 'use client' import { useState } from 'react' +import { useAuth } from '@/lib/auth/context' import ProfileSettings from '@/components/settings/ProfileSettings' import { motion, AnimatePresence } from 'framer-motion' import { UserIcon, + LockIcon, + BoxIcon, + ChevronRightIcon, ChevronDownIcon, + ExternalLinkIcon, } from '@ciphera-net/ui' +// --- Types --- + type ProfileSubTab = 'profile' | 'security' | 'preferences' +type ActiveSelection = + | { section: 'profile'; subTab: ProfileSubTab } + | { section: 'account' } + +type ExpandableSection = 'profile' | 'account' + +// --- Sidebar Components --- + function SectionHeader({ expanded, active, @@ -17,6 +32,7 @@ function SectionHeader({ icon: Icon, label, description, + hasChildren = true, }: { expanded: boolean active: boolean @@ -24,6 +40,7 @@ function SectionHeader({ icon: React.ElementType label: string description?: string + hasChildren?: boolean }) { return ( ) } @@ -56,10 +77,12 @@ function SubItem({ active, onClick, label, + external = false, }: { active: boolean onClick: () => void label: string + external?: boolean }) { return ( ) } @@ -95,56 +119,250 @@ function ExpandableSubItems({ expanded, children }: { expanded: boolean; childre ) } -export default function SettingsPageClient() { - const [activeSubTab, setActiveSubTab] = useState('profile') - const [expanded, setExpanded] = useState(true) +// --- Content Components --- + +function AccountManagementCard() { + const accountLinks = [ + { + label: 'Profile & Personal Info', + description: 'Update your name, email, and avatar', + href: 'https://auth.ciphera.net/settings', + icon: UserIcon, + }, + { + label: 'Security & 2FA', + description: 'Password, two-factor authentication, and passkeys', + href: 'https://auth.ciphera.net/settings?tab=security', + icon: LockIcon, + }, + { + label: 'Active Sessions', + description: 'Manage devices logged into your account', + href: 'https://auth.ciphera.net/settings?tab=sessions', + icon: BoxIcon, + }, + ] return ( -
-
-

Settings

-

- Manage your account settings and preferences. -

+
+
+
+ +
+
+

Ciphera Account

+

Manage your account across all Ciphera products

+
-
- {/* Sidebar Navigation */} - +
+ {accountLinks.map((link) => ( + + +
+
+ + {link.label} + + +
+

{link.description}

+
+ +
+ ))} +
- {/* Content Area */} -
- -
+
+

+ These settings apply to your Ciphera Account and affect all products (Drop, Pulse, and Auth). +

) } + +// --- Main Settings Section --- + +function AppSettingsSection() { + const [active, setActive] = useState({ section: 'profile', subTab: 'profile' }) + const [expanded, setExpanded] = useState>(new Set(['profile'])) + + const toggleSection = (section: ExpandableSection) => { + setExpanded(prev => { + const next = new Set(prev) + if (next.has(section)) { + next.delete(section) + } else { + next.add(section) + } + return next + }) + } + + const selectSubTab = (selection: ActiveSelection) => { + setActive(selection) + if ('subTab' in selection) { + setExpanded(prev => new Set(prev).add(selection.section as ExpandableSection)) + } + } + + const renderContent = () => { + switch (active.section) { + case 'profile': + return + case 'account': + return + default: + return null + } + } + + return ( +
+ {/* Sidebar Navigation */} + + + {/* Content Area */} +
+ {renderContent()} +
+
+ ) +} + +export default function SettingsPageClient() { + const { user } = useAuth() + + return ( +
+ {/* Page Header */} +
+

Settings

+

+ Manage your Pulse preferences and Ciphera account settings +

+
+ + {/* Breadcrumb / Context */} +
+ You are signed in as + {user?.email} + + + Manage in Ciphera Account + + +
+ + {/* Settings Content */} + +
+ ) +}