'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, onToggle, icon: Icon, label, description, hasChildren = true, }: { expanded: boolean active: boolean onToggle: () => void icon: React.ElementType label: string description?: string hasChildren?: boolean }) { return ( ) } function SubItem({ active, onClick, label, external = false, }: { active: boolean onClick: () => void label: string external?: boolean }) { return ( ) } function ExpandableSubItems({ expanded, children }: { expanded: boolean; children: React.ReactNode }) { return ( {expanded && (
{children}
)}
) } // --- 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 (

Ciphera Account

Manage your account across all Ciphera products

{accountLinks.map((link) => (
{link.label}

{link.description}

))}

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 */}
) }