// Left-pane category list for Settings. Keeps selection in // store.settingsPage so switching away and back preserves place. import React from 'react'; import { useStore, type SettingsPage } from '@/lib/store'; interface Row { key: SettingsPage; label: string; hint: string; } const ROWS: Row[] = [ { key: 'node', label: 'Node', hint: 'URL, connection status' }, { key: 'identity', label: 'Identity', hint: 'Your keys and address' }, { key: 'devices', label: 'Devices', hint: 'Linked devices, pair a new one' }, { key: 'about', label: 'About', hint: 'Version, links' }, ]; export function SettingsNav(): React.ReactElement { const page = useStore(s => s.settingsPage); const setPage = useStore(s => s.setSettingsPage); return (
{ROWS.map(r => ( setPage(r.key)} /> ))}
); } function NavEntry({ label, hint, active, onClick, }: { label: string; hint: string; active: boolean; onClick: () => void }) { return (
{ if (!active) (e.currentTarget as HTMLDivElement).style.background = '#0a0a0a'; }} onMouseLeave={e => { if (!active) (e.currentTarget as HTMLDivElement).style.background = 'transparent'; }} >
{label}
{hint}
); }