import AboutInfoDialog from '@/components/AboutInfoDialog' import Donation from '@/components/Donation' import { toAppearanceSettings, toEmojiPackSettings, toGeneralSettings, toPostSettings, toRelaySettings, toSystemSettings, toTranslation, toWallet } from '@/lib/link' import { cn } from '@/lib/utils' import { useSecondaryPage } from '@/PageManager' import { useNostr } from '@/providers/NostrProvider' import { Check, ChevronRight, Cog, Copy, Info, KeyRound, Languages, Palette, PencilLine, Server, Settings2, Smile, Wallet } from 'lucide-react' import { forwardRef, HTMLProps, useState } from 'react' import { useTranslation } from 'react-i18next' export default function Settings() { const { t } = useTranslation() const { pubkey, nsec, ncryptsec } = useNostr() const { push } = useSecondaryPage() const [copiedNsec, setCopiedNsec] = useState(false) const [copiedNcryptsec, setCopiedNcryptsec] = useState(false) return (
push(toGeneralSettings())}>
{t('General')}
push(toAppearanceSettings())}>
{t('Appearance')}
push(toRelaySettings())}>
{t('Relays')}
{!!pubkey && ( push(toTranslation())}>
{t('Translation')}
)} {!!pubkey && ( push(toWallet())}>
{t('Wallet')}
)} {!!pubkey && ( push(toPostSettings())}>
{t('Post settings')}
)} {!!pubkey && ( push(toEmojiPackSettings())}>
{t('Emoji Packs')}
)} {!!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})
push(toSystemSettings())}>
{t('System')}
) } const SettingItem = forwardRef>( ({ children, className, ...props }, ref) => { return (
{children}
) } ) SettingItem.displayName = 'SettingItem'