import { t } from '@/lib/i18n'
import type { KeyManagementManagerActions } from './useKeyManagementManager'
import type { KeyManagementManagerState } from './keyManagementController'
import { KeyManagementImportForm } from './KeyManagementImportForm'
export function KeyManagementImportSection(params: {
state: KeyManagementManagerState
actions: KeyManagementManagerActions
}): React.ReactElement {
return (
<>
>
)
}
function KeyManagementErrorBanner(params: { error: string | null }): React.ReactElement | null {
if (!params.error) {
return null
}
return (
)
}
function KeyManagementPublicKeysPanel(params: {
publicKeys: KeyManagementManagerState['publicKeys']
copiedNpub: boolean
copiedPublicKey: boolean
onCopyNpub: () => void
onCopyPublicKey: () => void
}): React.ReactElement | null {
if (!params.publicKeys) {
return null
}
return (
)
}
function KeyManagementKeyCard(params: {
label: string
value: string
copied: boolean
onCopy: () => void
}): React.ReactElement {
return (
{params.label}
{params.value}
)
}
function KeyManagementNoAccountBanner(params: {
publicKeys: KeyManagementManagerState['publicKeys']
accountExists: boolean
}): React.ReactElement | null {
if (params.publicKeys || params.accountExists) {
return null
}
return (
{t('settings.keyManagement.noAccount.title')}
{t('settings.keyManagement.noAccount.description')}
)
}
function KeyManagementImportButton(params: {
accountExists: boolean
showImportForm: boolean
onClick: () => void
}): React.ReactElement | null {
if (params.showImportForm) {
return null
}
return (
)
}