import AboutInfoDialog from '@/components/AboutInfoDialog' import { toGeneralSettings, toPostSettings, toRelaySettings, toCacheSettings, toWallet, toRssFeedSettings, toPersonalListsSettings } from '@/lib/link' import { cn } from '@/lib/utils' import { useSmartSettingsNavigation } from '@/PageManager' import { useNostr } from '@/providers/NostrProvider' import { Check, ChevronRight, Copy, Database, Info, KeyRound, PencilLine, Rss, Server, Settings2, Users, Wallet } from 'lucide-react' import { forwardRef, HTMLProps, useState } from 'react' import { useTranslation } from 'react-i18next' /** * Shared settings index rows (General, Relays, …). Used by the primary Settings page and * the secondary /settings route for deep links / stack restores. */ export default function SettingsMenuBody({ className }: { className?: string }) { const { t } = useTranslation() const { pubkey, nsec, ncryptsec } = useNostr() const { navigateToSettings } = useSmartSettingsNavigation() const [copiedNsec, setCopiedNsec] = useState(false) const [copiedNcryptsec, setCopiedNcryptsec] = useState(false) return (
navigateToSettings(toGeneralSettings())}>
{t('General')}
navigateToSettings(toRelaySettings())}>
{t('Relays and Storage Settings')}
navigateToSettings(toCacheSettings())}>
{t('Cache & offline storage')}
{!!pubkey && ( navigateToSettings(toWallet())}>
{t('Wallet')}
)} {!!pubkey && ( navigateToSettings(toPostSettings())}>
{t('Post settings')}
)} {!!pubkey && ( navigateToSettings(toRssFeedSettings())}>
{t('RSS Feed Settings')}
)} {!!pubkey && ( navigateToSettings(toPersonalListsSettings())}>
{t('Personal Lists')}
)} {!!nsec && ( { navigator.clipboard.writeText(nsec) setCopiedNsec(true) setTimeout(() => setCopiedNsec(false), 2000) }} >
{t('Copy private key')} (nsec)
{copiedNsec ? : }
)} {!!ncryptsec && ( { navigator.clipboard.writeText(ncryptsec) setCopiedNcryptsec(true) setTimeout(() => setCopiedNcryptsec(false), 2000) }} >
{t('Copy private key')} (ncryptsec)
{copiedNcryptsec ? : }
)}
{t('About')}
v{import.meta.env.APP_VERSION} ({import.meta.env.GIT_COMMIT})
Imwald
Im Wald
) } const SettingItem = forwardRef>( ({ children, className, ...props }, ref) => { return (
{children}
) } ) SettingItem.displayName = 'SettingItem'