- {error && (
-
- {error}
-
-
- )}
-
-
-
{t('settings.nip95.title')}
-
-
-
- {showAddForm && (
-
-
-
- setNewUrl(e.target.value)}
- placeholder={t('settings.nip95.add.placeholder')}
- className="w-full px-4 py-2 bg-cyber-darker border border-cyber-accent/30 rounded text-cyber-light focus:border-neon-cyan focus:outline-none"
- />
-
-
-
-
-
-
- )}
-
-
- {apis.length === 0 ? (
-
- {t('settings.nip95.empty')}
-
- ) : (
- apis.map((api, index) => (
-
{
- handleDragOver(e, api.id)
- }}
- onDragLeave={handleDragLeave}
- onDrop={(e) => {
- handleDrop(e, api.id)
- }}
- className={`bg-cyber-dark border rounded p-4 space-y-3 transition-all ${getApiCardClassName(api.id, draggedId, dragOverId)}`}
- >
-
-
-
{
- handleDragStart(e, api.id)
- e.stopPropagation()
- }}
- onMouseDown={(e) => {
- e.stopPropagation()
- }}
- >
-
-
-
- {editingId === api.id ? (
-
- {
- if (e.target.value !== api.url) {
- void handleUpdateUrl(api.id, e.target.value)
- } else {
- setEditingId(null)
- }
- }}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.currentTarget.blur()
- } else if (e.key === 'Escape') {
- setEditingId(null)
- }
- }}
- className="w-full px-3 py-2 bg-cyber-darker border border-neon-cyan/50 rounded text-cyber-light focus:border-neon-cyan focus:outline-none"
- autoFocus
- />
-
- ) : (
-
setEditingId(api.id)}
- title={t('settings.nip95.list.editUrl')}
- >
- {api.url}
-
- )}
-
-
-
-
-
-
-
-
-
- {t('settings.nip95.list.priorityLabel', { priority: index + 1, id: api.id })}
-
-
-
- ))
- )}
-
-
-
-
- {t('settings.nip95.note.title')} {t('settings.nip95.note.priority')}
-
-
- {t('settings.nip95.note.fallback')}
-
-
-
- )
-}
-
-function getApiCardClassName(apiId: string, draggedId: string | null, dragOverId: string | null): string {
- if (draggedId === apiId) {
- return 'opacity-50 border-neon-cyan'
- }
- if (dragOverId === apiId) {
- return 'border-neon-green shadow-lg'
- }
- return 'border-neon-cyan/30'
-}
+export { Nip95ConfigManager } from './nip95Config/Nip95ConfigManager'
diff --git a/components/RelayManager.tsx b/components/RelayManager.tsx
index 6971a7e..d96bf14 100644
--- a/components/RelayManager.tsx
+++ b/components/RelayManager.tsx
@@ -1,412 +1 @@
-import { useState, useEffect } from 'react'
-import { configStorage } from '@/lib/configStorage'
-import type { RelayConfig } from '@/lib/configStorageTypes'
-import { t } from '@/lib/i18n'
-import { userConfirm } from '@/lib/userConfirm'
-import { relaySessionManager } from '@/lib/relaySessionManager'
-import { DragHandle } from './DragHandle'
-
-interface RelayManagerProps {
- onConfigChange?: () => void
-}
-
-export function RelayManager({ onConfigChange }: RelayManagerProps): React.ReactElement {
- const [relays, setRelays] = useState